-------- Original Message -------- Delivered-To: [EMAIL PROTECTED]
To make matters worse, "$x[5] = NULL;" causes array_key_exists to return true for 5 even though isset($x[5]) is false and even worse, "unset" is the function you use to remove 5/NULL from the array. So... you have to "unset" something for which "isset" is false! I have to believe if they were starting from scratch today they wouldn't make such a mess, but too many people have code that relies on this unfortunate behavior for them to change it now. :(
- Todd
On Thu, 2004-04-08 at 11:05, Jochem Maas wrote:
consider this if you will:
<?
echo <<< ___THEEND EXPECT: isset(): true; is_null(): true;
REALITY: ___THEEND;
$varIsSet = null; var_dump( isset($varIsSet) ); var_dump( is_null($varIsSet) );
?>
I would have thought that having set the variable to something even if its 'nothing' would mean it is set in the current variable scope.
either that or it makes unset() redundant, no? and the PHP documentation
leaves me with the impression that is_null() works with 'set' variables (and would give an E_NOTICE if an unset variable is set)
is there a difference between null and unset()ing? does a variable that is null take up no memory (rather like variable that have never been defined or removed completely)
apologies if this is misplaced.
rgds,
Jochem
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php