php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13073 empty() returns wrong value
Submitted: 2001-08-31 04:19 UTC Modified: 2001-08-31 14:31 UTC
From: carsten dot senf at novasib dot de Assigned:
Status: Not a bug Package: Variables related
PHP Version: 4.0.6 OS: Linux, Windows2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: carsten dot senf at novasib dot de
New email:
PHP Version: OS:

 

 [2001-08-31 04:19 UTC] carsten dot senf at novasib dot de
Hi,

the value of iid comes from the URL-request-string. I.e. &iid=0
If I test of the emptyness of $iid, empty($iid) returns FALSE, but $iid is not empty.

if (empty($iid)) {
$iid = '5.1';
}

The test "if ($iid == '') returns the right value.

regards,
Carsten

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-31 06:31 UTC] cynic@php.net
I suggest you turn your attention to the PHP manual.
(Though I admit that the fact that empty() returns true for 0 and "0" could be stresse more in the manual page.)
 [2001-08-31 14:31 UTC] jeroen@php.net
"empty($iid) returns FALSE, but $iid is not empty."

$iid is NOT empty, so it indeed returns false... :-)


 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Nov 24 16:01:24 2020 UTC