Re: [RFC] Allow non-variable arguments to empty() and isset()
| From: | Pierre Joye | Date: | Wed, 02 May 2012 09:43:03 +0000 |
| Subject: | Re: [RFC] Allow non-variable arguments to empty() and isset() | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-60418@lists.php.net to get a copy of this message | ||
hi,
On Wed, May 2, 2012 at 11:36 AM, Ferenc Kovacs <tyra3l@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).
>> 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.
Cheers,
--
Pierre
@pierrejoye | http://blog.thepimp.net | http://www.libgd.org