#48115 [NEW]: array_unique() drops int(0)

From: Date: Wed, 29 Apr 2009 21:50:36 +0000
Subject: #48115 [NEW]: array_unique() drops int(0)
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-136524@lists.php.net to get a copy of this message
From: ms419 at freezone dot co dot uk Operating system: Debian PHP version: 5.2CVS-2009-04-29 (snap) PHP Bug Type: Arrays related Bug description: array_unique() drops int(0) 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 bug report at http://bugs.php.net/?id=48115&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48115&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48115&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48115&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=48115&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48115&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=48115&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=48115&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=48115&r=needscript Try newer version: http://bugs.php.net/fix.php?id=48115&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=48115&r=support Expected behavior: http://bugs.php.net/fix.php?id=48115&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=48115&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=48115&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=48115&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48115&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=48115&r=dst IIS Stability: http://bugs.php.net/fix.php?id=48115&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=48115&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=48115&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=48115&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=48115&r=mysqlcfg

« previous php.bugs (#136524) next »