On Wed, May 2, 2012 at 11:43 AM, Pierre Joye <pierre....@gmail.com> wrote:
> hi, > > On Wed, May 2, 2012 at 11:36 AM, Ferenc Kovacs <tyr...@gmail.com> wrote: > > > $foo=null; > > var_dump(isset($foo)); //prints bool(false) > > No offset meant, but it is totally expected and well known, and as far > as I remember documented too. Assigning NULL to a variable unsets it > (so to say). > > sure, as I quoted the documentation here. I just wanted to emphasize, that isset not only checks if a variable is set or not, but also checks the value of the variable, which makes your argument ("An expression is not set per se. isset goals, by design, from the very1st day, is to test the existence of a variable and a variable only.") much weaker. > >> empty() on the other hand, tests if something is empty, and only if it > >> is empty. The result of an expression can be empty. > >> > > > > an expression can also have a value of null. > > And NULL is empty. No issue here. > yeah, but that wasn't my point, I was saying that an expression can also have a value of null, which can be checked by isset, so empty and isset isn't any different in that regard for expressions. -- Ferenc Kovács @Tyr43l - http://tyrael.hu