Re: Re: variable_exists() patch
| From: | Ilia Alshanetsky | Date: | Thu, 14 Aug 2003 19:59:05 +0000 |
| Subject: | Re: Re: variable_exists() patch | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-3959@lists.php.net to get a copy of this message | ||
On August 14, 2003 03:33 pm, Robert Cummings wrote:
> Actually isset() doesn't behave as it should:
>
> $foo = null;
> echo isset( $foo );
Not quite. To understand the nature of NULL you must consider the following.
Suppose you have a variable $foo you wish to 'destroy' you can do so by doing
unset($foo) or $foo = NULL;. In both cases the value of $foo will be
destroyed, however the variable will remain, it's value will become NULL.
Therefor isset() behaviour, which works by seeing if a variable exists and
making sure that its value is not null, is correct and now flawed as you
claim. This is true for other languages as well such as C, when a pointer's
value is null that pointer is 'no set'.
Ilia