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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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 10:00:02 2026 UTC