php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2088 empty() not working correctly
Submitted: 1999-08-17 11:03 UTC Modified: 1999-08-17 11:07 UTC
From: musone at edgeglobal dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Latest CVS (17/08/1999) OS: Linux
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: musone at edgeglobal dot com
New email:
PHP Version: OS:

 

 [1999-08-17 11:03 UTC] musone at edgeglobal dot com
the following produces a result of "1"

$name="0";
echo empty($name);

this should not be considered empty, from what i understand,
and it was also a fix in php3.0 a while back. 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-08-17 11:07 UTC] andrey at cvs dot php dot net
The manual states:
"Returns false if var is set and has a non-empty or non-zero value; true otherwise. "

Since the variable has the value of 0, it is considered empty.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 05:01:28 2024 UTC