#39811 [NEW]: array_diff "compare with 2" bug

From: Date: Wed, 13 Dec 2006 07:49:55 +0000
Subject: #39811 [NEW]: array_diff "compare with 2" bug
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-106286@lists.php.net to get a copy of this message
From: wishm at bk dot ru Operating system: win32 PHP version: 4.4.4 PHP Bug Type: Arrays related Bug description: array_diff "compare with 2" bug Description: ------------ array_diff() function fails on comparing any array element with 2, when another pair of elements are both set to 2. Fails with that settings only. Reproduce code: --------------- <?php $a = array("2","2"); $b = array("2","any_symbols_here"); // same thing on $b = array("any_symbols_here","2"); print_r(array_diff($a,$b)); ?> Expected result: ---------------- Array ( [1] => 2 ) // second elements are not equal so function should return that element from $a array Actual result: -------------- Array ( ) //empty array - function failed -- Edit bug report at http://bugs.php.net/?id=39811&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39811&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39811&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39811&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39811&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39811&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39811&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39811&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39811&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39811&r=support Expected behavior: http://bugs.php.net/fix.php?id=39811&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39811&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39811&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39811&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39811&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39811&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39811&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39811&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39811&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39811&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39811&r=mysqlcfg

« previous php.bugs (#106286) next »