#33539 [NEW]: array_search returns wrong value

From: Date: Fri, 01 Jul 2005 17:38:14 +0000
Subject: #33539 [NEW]: array_search returns wrong value
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-81276@lists.php.net to get a copy of this message
From: martin dot mohr at bytec dot de Operating system: Linux 2.4.27 PHP version: 4.3.11 PHP Bug Type: Arrays related Bug description: array_search returns wrong value Description: ------------ Using array_search with "haystack" completly numeric and the first 16 digits identic a wrong key is returned. This does not occur if one character is in the "haystack" or if there is any difference in the first 16 digits. Reproduce code: --------------- <? $a = array (11 => "99999999999999999999999999", 57 => "11022625212002021111111111", 80 => "11022625212002021051765412"); print_r($a); $b = array_search ("11022625212002021051765412", $a); echo $b; ?> Expected result: ---------------- Array ( [11] => 99999999999999999999999999 [57] => 11022625212002021111111111 [80] => 11022625212002021051765412 ) 80 Actual result: -------------- Array ( [11] => 99999999999999999999999999 [57] => 11022625212002021111111111 [80] => 11022625212002021051765412 ) 57 -- Edit bug report at http://bugs.php.net/?id=33539&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33539&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33539&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33539&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=33539&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=33539&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=33539&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=33539&r=needscript Try newer version: http://bugs.php.net/fix.php?id=33539&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=33539&r=support Expected behavior: http://bugs.php.net/fix.php?id=33539&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=33539&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=33539&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=33539&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33539&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=33539&r=dst IIS Stability: http://bugs.php.net/fix.php?id=33539&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=33539&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=33539&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=33539&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=33539&r=mysqlcfg

« previous php.bugs (#81276) next »