1--TEST-- 2Test prev() function : error conditions - Pass incorrect number of arguments 3--FILE-- 4<?php 5/* Prototype : mixed prev(array $array_arg) 6 * Description: Move array argument's internal pointer to the previous element and return it 7 * Source code: ext/standard/array.c 8 */ 9 10/* 11 * Pass incorrect number of arguments to prev() to test behaviour 12 */ 13 14echo "*** Testing prev() : error conditions ***\n"; 15 16// Zero arguments 17echo "\n-- Testing prev() function with Zero arguments --\n"; 18var_dump( prev() ); 19 20//Test prev with one more than the expected number of arguments 21echo "\n-- Testing prev() function with more than expected no. of arguments --\n"; 22$array_arg = array(1, 2); 23$extra_arg = 10; 24var_dump( prev($array_arg, $extra_arg) ); 25?> 26===DONE=== 27--EXPECTF-- 28*** Testing prev() : error conditions *** 29 30-- Testing prev() function with Zero arguments -- 31 32Warning: prev() expects exactly 1 parameter, 0 given in %s on line %d 33NULL 34 35-- Testing prev() function with more than expected no. of arguments -- 36 37Warning: prev() expects exactly 1 parameter, 2 given in %s on line %d 38NULL 39===DONE=== 40