#48115 [Opn->Bgs]: array_unique() drops int(0)
| From: | jani@php.net | Date: | Thu, 30 Apr 2009 08:26:50 +0000 |
| Subject: | #48115 [Opn->Bgs]: array_unique() drops int(0) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-136541@lists.php.net to get a copy of this message | ||
ID: 48115
Updated by: jani@php.net
Reported By: ms419 at freezone dot co dot uk
-Status: Open
+Status: Bogus
Bug Type: Arrays related
Operating System: Debian
PHP Version: 5.2CVS-2009-04-29 (snap)
New Comment:
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same.
Thank you for your interest in PHP.
See bug #47370
Previous Comments:
------------------------------------------------------------------------
[2009-04-29 21:50:36] ms419 at freezone dot co dot uk
Description:
------------
array_unique() on an array with strings and the value int(0) drops
int(0)
or if int(0) comes first, it drops the first string
Reproduce code:
---------------
jablko@tad:~/php5.2-200904292030$ sapi/cli/php -r
'var_dump(array_unique(array("foo", 0)));'
array(1) {
[0]=>
string(3) "foo"
}
jablko@tad:~/php5.2-200904292030$
Expected result:
----------------
array(2) {
[0]=>
string(3) "foo"
[1]=>
int(0)
}
Actual result:
--------------
array(1) {
[0]=>
string(3) "foo"
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48115&edit=1