Re: PHP 4.0 Bug #2356 Updated: empty() does not work (see 2088)
| From: | Joey | Date: | Mon, 15 Nov 1999 19:23:15 +0000 |
| Subject: | Re: PHP 4.0 Bug #2356 Updated: empty() does not work (see 2088) | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-12570@lists.php.net to get a copy of this message | ||
The question is:
is the string "0" 'empty'?
Under PHP3, it did not. Now it does under PHP4.
--Joey Smith
On Mon, 15 Nov 1999, Paul Marquis wrote:
> If I remember the problem correctly (boy, it's amazing what you
> forget), the following code snippet will produce different results in
> PHP 3 and PHP 4:
>
> <?
> $name = "0";
> echo empty($name);
> ?>
>
> Andrei Zmievski wrote:
> >
> > >
> > > I am betting that this is bcz of the dynamnic tying.
> > > Either way, marking it as "Misbehaving Function"
> > >
> > > Note that:
> > > <?
> > >
> > > $name=0;
> > > echo empty($name);
> > > ?>
> > >
> > > prints 1 under php3 && 4.
> >
> > Check the documentation again. empty() will return 1 if the
> > argument is "" or 0.
> >
> > -Andrei