Re: variable_exists() patch
| From: | Zeev Suraski | Date: | Thu, 14 Aug 2003 23:27:03 +0000 |
| Subject: | Re: variable_exists() patch | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-3967@lists.php.net to get a copy of this message | ||
At 21:15 14/08/2003, walt boring wrote:
Ilia Alshanetsky wrote:It's just that 'null' is not a value. The way PHP treats null value is identical to that of non existent values, which is precisely why isset() behaves the way that it does. I'm not sure what the logic is behind Ilia's alternatives, they won't behave any differently whether $var exists and is null, or whether it doesn't exist at all, and it's intentional. ZeevDo we really need this function? I see 2 ways of 'implementing' this functionality in PHP without having to add another function. For example: (isset($var) || is_null($var)) or gettype($var). IliaI for one would like to see something like variable_exists(), as I am very annoyed with the logic of isset() returning false if the variable exists and has a value of null. The name of the function in this case doesn't not fit the logic for isset(). The variable does exist and it IS in fact set, the value just so happens to be null.