|  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
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.
Bug Type:
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

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.



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-31 06:31 UTC]
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]
"empty($iid) returns FALSE, but $iid is not empty."

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

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Nov 30 11:01:27 2023 UTC