From:             andrew at netrux dot com
Operating system: 
PHP version:      Irrelevant
PHP Bug Type:     Documentation problem
Bug description:  array_search example bug

Description:
------------
<?php
$array = array(0 => "blue", 1 => "red", 2 => "green", 3 => "red");

$key = array_search($array, "green"); // $key = 2;
$key = array_search($array, "red");  // $key = 1;
?> 

The array_search examples arguments are the wrong way around, there
searching the needle with the haystack ;)


-- 
Edit bug report at http://bugs.php.net/?id=26761&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26761&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26761&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=26761&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=26761&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=26761&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=26761&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=26761&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=26761&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=26761&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=26761&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=26761&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=26761&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26761&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=26761&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=26761&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=26761&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26761&r=float

Reply via email to