Re: Inconsistency of empty() and isset() ?

From: Date: Tue, 18 Apr 2006 00:26:42 +0000
Subject: Re: Inconsistency of empty() and isset() ?
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to internals+get-22822@lists.php.net to get a copy of this message
Nope you shouldn't, as per my previous email. At 10:46 AM 4/17/2006, itrebal@gmail.com wrote:
Should I go ahead and submit this patch? Where should I go about doing so? I looked around bugs.php.net but am unsure. On 4/17/06, Ron Korving <r.korving@xit.nl> wrote: isset() does more than check the existance in a hash table, because this the following is true: $foo = null; isset($foo); // returns false, even though $foo is initialized
echo $foo;    // will not cause a NOTICE, because $foo is initialized
- Ron ""Richard Lynch"" <ceo@l-i-e.com> wrote in message news:3516.209.254.223.2.1145240948.squirrel@www.l-i-e.com...
On Sun, April 16, 2006 7:38 pm, Pierre wrote:
isset and empty share the same implementation, the only difference is what they return (in short). They behave "the same", they should continue do so if empty accept many arguments.
Actually... Unless the docs are lying to me... empty() checks the contents of the value, and does something quite different based on the value found. isset() just plain checks in the hash table[s] if the variable has been assigned, and that's it. Plus, the meaning of empty() changed in some a way with "0" between versions 3 and 4, and then again with respect to objects with no properties between 4 and 5. isset() has never changed its meaning out from under me. :-) So, while the guts of the function may be the same in source, there's got to be some kind of flag or something going on for empty() to be checking all those values, no??? -- Like Music? http://l-i-e.com/artists.htm
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php -- ------------------------------------ Graham Christensen www.itrebal.com www.iamgraham.net


« previous php.internals (#22822) next »