#31813 [Bgs->Csd]: Bogus empty()
| From: | stach at chello dot pl | Date: | Wed, 02 Feb 2005 13:42:08 +0000 |
| Subject: | #31813 [Bgs->Csd]: Bogus empty() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-73267@lists.php.net to get a copy of this message | ||
ID: 31813
User updated by: stach at chello dot pl
Reported By: stach at chello dot pl
-Status: Bogus
+Status: Closed
Bug Type: Arrays related
Operating System: win32 (2000srv)
PHP Version: 4.3.10
New Comment:
I've found the explanation that empty() should work like this (however
pre 4.3.10 empty in case like that would return false as I would
expect). 0 in a string is not an empty value, and in my opinion empty
should return false in case like this. But thats my thinkin :)
Previous Comments:
------------------------------------------------------------------------
[2005-02-02 14:39:40] tony2001@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
"empty() returns FALSE if var has a non-empty and non-zero value."
http://php.net/empty
------------------------------------------------------------------------
[2005-02-02 14:28:18] stach at chello dot pl
Description:
------------
function empty returns true when the value of the variable is '0'
(string).
Reproduce code:
---------------
$d['id'][0] = '0';
var_dump(empty($d['id'][0]));
Expected result:
----------------
false
Actual result:
--------------
true
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31813&edit=1