On Fri, May 1, 2009 at 4:05 AM, Darren wrote:
> This was discussed for PHP6, but eventually decided not to have such a
> function. Instead, we now have the following: $var = $_GET['var'] ?: 5;
>
> Taken from http://www.corephp.co.uk/archives/19-Prepare-for-PHP-6.html
>
> 'you'd be able to do so
of isset() + overhead of
> ?:
>
> Case 3
> ---
> $c = ifset($a,$b)
> // total time = overhead of ifset()
>
>
>
> Best regards
>
> __
> Raymond Irving
>
> --- On Thu, 4/30/09, Daniel Brown wrote:
>
> > From: Daniel Brown
> > Subject: Re:
From: Daniel Brown
> Subject: Re: [PHP] Two very useful PHP functions
> To: "Raymond Irving"
> Cc: php-general@lists.php.net
> Date: Thursday, April 30, 2009, 11:37 AM
> On Wed, Apr 29, 2009 at 22:32,
> Raymond Irving
> wrote:
> >
> > What do you think? C
On Wed, Apr 29, 2009 at 22:32, Raymond Irving wrote:
>
> What do you think? Can they make it into 5.3?
Not when doing the ternary operator that you even displayed
yourself takes up less code and time than a core function would. It's
a good idea, but better handled on the frontend of things.
Hello,
Every so often I have to be using the isset() function to check if a variable
exists. It would be useful to have something like an ifset() function
Instead of doing this
$v = isset($input) ? $input : $default;
we can do this
$v = ifset($input,$default);
// returns $input if it exists
5 matches
Mail list logo