Re: PHP 4.0 Bug #2356 Updated: empty() does not work (see 2088)
| From: | Paul Marquis | Date: | Mon, 15 Nov 1999 18:58:50 +0000 |
| Subject: | Re: PHP 4.0 Bug #2356 Updated: empty() does not work (see 2088) | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-12568@lists.php.net to get a copy of this message | ||
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:
>
> On Sun, 14 Nov 1999, Bug Database wrote:
> > ID: 2356
> > Updated by: joey
> > Reported By: pmarquis@iname.com
> > Status: Open
> > Bug Type: Misbehaving function
> > Assigned To:
> > Comments:
> >
> > 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
>
> Any sufficiently advanced bug is
> indistinguishable from a feature.
> -- Rich Kulawiec
--
Paul Marquis
pmarquis@iname.com
What hair color do they put on the driver's licenses of bald men?