#18612 [Opn->Bgs]: array_search has wrong output

From: Date: Sun, 28 Jul 2002 13:15:39 +0000
Subject: #18612 [Opn->Bgs]: array_search has wrong output
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-15443@lists.php.net to get a copy of this message
ID: 18612 Updated by: eru@php.net Reported By: b-roeser@gmx.net -Status: Open +Status: Bogus Bug Type: Arrays related Operating System: Linux 2.2.14 PHP Version: 4.1.2 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Previous Comments: ------------------------------------------------------------------------ [2002-07-28 08:55:15] b-roeser@gmx.net 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 this bug report at http://bugs.php.net/?id=18612&edit=1

« previous php.bugs (#15443) next »