Re: Before March 1st aka PHP 5.1 beta
| From: | Jason Garber | Date: | Thu, 17 Feb 2005 20:05:59 +0000 |
| Subject: | Re: Before March 1st aka PHP 5.1 beta | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-15061@lists.php.net to get a copy of this message | ||
Hello Andi,
>>4) php 5.1 is aiming to increase performance and security => ifsetor
>>
>> It is nice and easy and fast...only it's name. Well guys come on that's
>> the stupiest reason to reject. The name is selfspeaking, you're all only
>> not so used to its name as you are with foreach for now.
AG> It wasn't only the name but also the implementation. Actually, I was hoping
AG> that the input filter API would resolve this issue once and for all even if
AG> in a bit of a different (and IMO better) way.
Input filtering does not solve the problem ifsetor() is designed to
solve. It tackles a small part of it, but ifsetor() is a general purpose
construct that is used for $_GET, $_POST, as well as ANY OTHER array
element or variable in your script.
$x = ifsetor($somearray[$foo][$bar], 0);
Is a lot cleaner than:
$x = isset($somearray[$foo][$bar]) ? $somearray[$foo][$bar] : 0;
--
ifsetor()'s purpose is simple and clear:
To return a variable value if it exists or a default value if it does
not exist WITHOUT generating any error.
Thanks.
--
Best regards,
Jason mailto:jason@ionzoft.com