1--TEST-- 2Test array_reverse() function : error conditions 3--FILE-- 4<?php 5/* Prototype : array array_reverse(array $array [, bool $preserve_keys]) 6 * Description: Return input as a new array with the order of the entries reversed 7 * Source code: ext/standard/array.c 8*/ 9 10echo "*** Testing array_reverse() : error conditions ***\n"; 11 12// zero arguments 13echo "\n-- Testing array_reverse() function with Zero arguments --\n"; 14var_dump( array_reverse() ); 15 16// more than the expected number of arguments 17echo "\n-- Testing array_diff() function with more than expected no. of arguments --\n"; 18$array = array(1, 2, 3, 4, 5, 6); 19$extra_arg = 10; 20var_dump( array_reverse($array, true, $extra_arg) ); 21var_dump( array_reverse($array, false, $extra_arg) ); 22 23echo "Done"; 24?> 25--EXPECTF-- 26*** Testing array_reverse() : error conditions *** 27 28-- Testing array_reverse() function with Zero arguments -- 29 30Warning: array_reverse() expects at least 1 parameter, 0 given in %s on line %d 31NULL 32 33-- Testing array_diff() function with more than expected no. of arguments -- 34 35Warning: array_reverse() expects at most 2 parameters, 3 given in %s on line %d 36NULL 37 38Warning: array_reverse() expects at most 2 parameters, 3 given in %s on line %d 39NULL 40Done 41