>> Great analysis. What about answering the question? Stanislav Malyshev
>> said some months ago this is 'strange', see the discussion around bug
>> 6076. Tell us at least, why this actually isn't strange.
>
> By default, any unset variable has value NULL - and isset(NULL) returns
> false to indicate that. Similarly, assigning NULL to a variable unsets
> it.
>
> -Andrei
> * The great thing about standards is that there are so many to choose from. *
Well, sure, isset(NULL) should return false, it's not a variable set in the
scope. A constant(?) yes, but not a variable.
But if you set a variable at some point in a script, would it not stand to
reason that that name is in the global/local namespace, and therefore IS
set?
It's somewhat conflicting when you reason:
<?php
$a = 1;
$b = 2;
$c = NULL;
print_r($GLOBALS);
?>
Yields:
<snip>
[GLOBALS] => Array
*RECURSION*
[a] => 1
[b] => 2
[c] =>
)
So, $c is set, since it is contained in $GLOBALS. Yet it's not, because it's
NULL.
I vote for isset() on a NULL value should be true if it's in the namespace.
Mark J. Hershenson
[EMAIL PROTECTED]
http://www.green-ant.com/
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]