diff options
Diffstat (limited to 'ext/standard/tests/array/array_search_errors.phpt')
| -rw-r--r-- | ext/standard/tests/array/array_search_errors.phpt | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/ext/standard/tests/array/array_search_errors.phpt b/ext/standard/tests/array/array_search_errors.phpt index d02b9bc95d..8f13497bb8 100644 --- a/ext/standard/tests/array/array_search_errors.phpt +++ b/ext/standard/tests/array/array_search_errors.phpt @@ -1,39 +1,44 @@ --TEST-- -Test array_search() and in_array() functions (errors) +Test array_search() function - error conditions --FILE-- <?php +/* + * Prototype : mixed array_search ( mixed $needle, array $haystack [, bool $strict] ) + * Description: Searches haystack for needle and returns the key if it is found in the array, FALSE otherwise + * Source Code: ext/standard/array.c +*/ -echo "\n*** Testing error conditions of in_array() ***\n"; +echo "*** Testing error conditions of array_search() ***\n"; /* zero argument */ -var_dump( in_array() ); +var_dump( array_search() ); -/* unexpected no.of arguments in in_array() */ +/* unexpected no.of arguments in array_search() */ $var = array("mon", "tues", "wed", "thurs"); -var_dump( in_array(1, $var, 0, "test") ); -var_dump( in_array("test") ); +var_dump( array_search(1, $var, 0, "test") ); +var_dump( array_search("test") ); -/* unexpected second argument in in_array() */ +/* unexpected second argument in array_search() */ $var="test"; -var_dump( in_array("test", $var) ); -var_dump( in_array(1, 123) ); +var_dump( array_search("test", $var) ); +var_dump( array_search(1, 123) ); echo "Done\n"; ?> --EXPECTF-- -*** Testing error conditions of in_array() *** +*** Testing error conditions of array_search() *** -Warning: Wrong parameter count for in_array() in %s on line %d +Warning: Wrong parameter count for array_search() in %s on line %d NULL -Warning: Wrong parameter count for in_array() in %s on line %d +Warning: Wrong parameter count for array_search() in %s on line %d NULL -Warning: Wrong parameter count for in_array() in %s on line %d +Warning: Wrong parameter count for array_search() in %s on line %d NULL -Warning: in_array(): Wrong datatype for second argument in %s on line %d +Warning: array_search(): Wrong datatype for second argument in %s on line %d bool(false) -Warning: in_array(): Wrong datatype for second argument in %s on line %d +Warning: array_search(): Wrong datatype for second argument in %s on line %d bool(false) Done |
