Re: [RFC] Allow non-variable arguments to empty() and isset()
| From: | Ferenc Kovacs | Date: | Wed, 02 May 2012 09:36:39 +0000 |
| Subject: | Re: [RFC] Allow non-variable arguments to empty() and isset() | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-60417@lists.php.net to get a copy of this message | ||
On Wed, May 2, 2012 at 11:10 AM, Pierre Joye <pierre.php@gmail.com> wrote:
> hi,
>
> On Wed, May 2, 2012 at 10:46 AM, Laruence <laruence@php.net> wrote:
>
> > so I think if you want to change empty, you should also change isset..
>
> An expression is not set per se. isset goals, by design, from the very
> 1st day, is to test the existence of a variable and a variable only.
>
"Returns TRUE if var exists and has value other than NULL, FALSE otherwise."
$foo=null;
var_dump(isset($foo)); //prints bool(false)
>
> 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.
--
Ferenc Kovács
@Tyr43l - http://tyrael.hu