Re: Before March 1st aka PHP 5.1 beta

From: Date: Thu, 17 Feb 2005 20:21:45 +0000
Subject: Re: Before March 1st aka PHP 5.1 beta
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-15063@lists.php.net to get a copy of this message
Yeah I realize it's different but my idea was that if you have something like: filter_get(POST, "foo", FILTER_NUMBER) the semantics of this or some other function could be: if (isset($_POST["foo"]) && is_number(..... I think in most cases that would do and doesn't require to add/change opcodes and language constructs... Andi At 03:05 PM 2/17/2005 -0500, Jason Garber wrote:
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


« previous php.internals (#15063) next »