1--TEST-- 2array_search() tests 3--FILE-- 4<?php 5 6$a = array(1=>0, 2=>1, 4=>3, "a"=>"b", "c"=>"d"); 7 8var_dump(array_search(1)); 9var_dump(array_search(1,1)); 10var_dump(array_search("a",$a)); 11var_dump(array_search("0",$a, true)); 12var_dump(array_search("0",$a)); 13var_dump(array_search(0,$a)); 14var_dump(array_search(1,$a)); 15var_dump(array_search("d",$a, true)); 16var_dump(array_search("d",$a)); 17var_dump(array_search(-1,$a, true)); 18 19echo "Done\n"; 20?> 21--EXPECTF-- 22Warning: array_search() expects at least 2 parameters, 1 given in %s on line %d 23NULL 24 25Warning: array_search() expects parameter 2 to be array, int given in %s on line %d 26NULL 27int(1) 28bool(false) 29int(1) 30int(1) 31int(2) 32string(1) "c" 33int(1) 34bool(false) 35Done 36