#18612 [NEW]: array_search has wrong output

From: Date: Sun, 28 Jul 2002 12:55:15 +0000
Subject: #18612 [NEW]: array_search has wrong output
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-15442@lists.php.net to get a copy of this message
From: b-roeser@gmx.net Operating system: Linux 2.2.14 PHP version: 4.1.2 PHP Bug Type: Arrays related Bug description: array_search has wrong output I wrote a small script: <?php $array[0]=5; $array[1]=5; $a = max($array); $key = array_search($a, $array); echo $a."-".$key; ?> I expected the following output: 5-Array Because there are two elements 5 in the Array: 0 and 1 But I got the following Output: 5-1 I read the manual and saw, that array_search should give an ouput of type "mixed". So I expect this to be a bug, because I didn't get an array. Thanks, Beefy. -- Edit bug report at http://bugs.php.net/?id=18612&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=18612&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=18612&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=18612&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=18612&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=18612&r=support Expected behavior: http://bugs.php.net/fix.php?id=18612&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=18612&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=18612&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=18612&r=globals

« previous php.bugs (#15442) next »