Re: Two very useful PHP functions
| From: | Raymond Irving | Date: | Fri, 01 May 2009 01:46:17 +0000 |
| Subject: | Re: Two very useful PHP functions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-292168@lists.php.net to get a copy of this message | ||
Hi Colin and Daniel,
Thanks for the feedback.
I know that this functionality can be added to a framework or a stand alone function but I'm
assuming that we would not get the same performance:
Case 1
-----------
$c = isset($a) ? $a : '';
// total time = overhead of isset() + overhead of ?:
Case 2
-----------
$c = myWrapper($a,$b)
// total time = overhead of myWrapper() + overhead 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 <danbrown@php.net> wrote:
> From: Daniel Brown <danbrown@php.net>
> Subject: Re: [PHP] Two very useful PHP functions
> To: "Raymond Irving" <xwisdom@yahoo.com>
> Cc: php-general@lists.php.net
> Date: Thursday, April 30, 2009, 11:37 AM
> On Wed, Apr 29, 2009 at 22:32,
> Raymond Irving <xwisdom@yahoo.com>
> 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. You may
> want to consider contributing that to a framework, which is
> where it
> would be more appropriate.
>
> --
> </Daniel P. Brown>
> daniel.brown@parasane.net
> || danbrown@php.net
> http://www.parasane.net/ ||
> http://www.pilotpig.net/
> 50% Off All Shared Hosting Plans at PilotPig: Use Coupon
> DOW10000
>