Re: [PHP] Two very useful PHP functions

2009-05-01 Thread Andrew Ballard
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

Re: [PHP] Two very useful PHP functions

2009-05-01 Thread Darren
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:

Re: [PHP] Two very useful PHP functions

2009-04-30 Thread Raymond Irving
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

Re: [PHP] Two very useful PHP functions

2009-04-30 Thread Daniel Brown
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.

[PHP] Two very useful PHP functions

2009-04-29 Thread Raymond Irving
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