php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2356 empty() does not work (see 2088)
Submitted: 1999-09-22 12:47 UTC Modified: 2000-05-22 04:23 UTC
From: pmarquis at iname dot com Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0 Beta 2 OS: Linux (RedHat 6.0)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: pmarquis at iname dot com
New email:
PHP Version: OS:

 

 [1999-09-22 12:47 UTC] pmarquis at iname dot com
I'd like to reopen bug report 2088 (I didn't know of
a better way than doing this), since the semantics
are changing between PHP 3.0 and PHP 4.0.

Is the string '0' non-zero?  I personally think so, as
it's not a number.  I know of at least one application (phpMyAdmin) which breaks because of this inconsistency.

If you're going to change the semantics of empty, I think
it would be a good idea to at least document it.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-11-14 16:30 UTC] joey at cvs dot php dot net
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.
 [2000-05-22 04:23 UTC] joey at cvs dot php dot net
Added to incompatibilities.php.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 11:00:01 2026 UTC