Bug #16146: array_search always skips first element of array

From: Date: Mon, 18 Mar 2002 15:23:39 +0000
Subject: Bug #16146: array_search always skips first element of array
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-2767@lists.php.net to get a copy of this message
From: carl@bodgadle.com Operating system: Solaris PHP version: 4.0.6 PHP Bug Type: Arrays related Bug description: array_search always skips first element of array I think i've discovered a problem with array_search. If I have an array, say $arr = Array("one","two","a"); then I try $retVal = array_search("one",$arr); it will return false, however the other two elements are fine. It seems array_search just ignores the first element in the array, I can search the rest of the array fine, just not the first element. If I put another item at the start I can find "one" fine. in_array works fine, it's just array_search that fails -- Edit bug report at http://bugs.php.net/?id=16146&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=16146&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=16146&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=16146&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=16146&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=16146&r=support Expected behavior: http://bugs.php.net/fix.php?id=16146&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=16146&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=16146&r=submittedtwice

« previous php.bugs (#2767) next »