1--TEST-- 2Test array_unshift() function : error conditions 3--FILE-- 4<?php 5/* Prototype : int array_unshift(array $array, mixed $var [, mixed ...]) 6 * Description: Pushes elements onto the beginning of the array 7 * Source code: ext/standard/array.c 8*/ 9 10echo "*** Testing array_unshift() : error conditions ***\n"; 11 12// Zero arguments 13echo "\n-- Testing array_unshift() function with Zero arguments --\n"; 14var_dump( array_unshift() ); 15 16// Testing array_unshift with one less than the expected number of arguments 17echo "\n-- Testing array_unshift() function with less than expected no. of arguments --\n"; 18$array = array(1, 2); 19var_dump( array_unshift($array) ); 20echo "Done"; 21?> 22--EXPECTF-- 23*** Testing array_unshift() : error conditions *** 24 25-- Testing array_unshift() function with Zero arguments -- 26 27Warning: array_unshift() expects at least 2 parameters, 0 given in %s on line %d 28NULL 29 30-- Testing array_unshift() function with less than expected no. of arguments -- 31 32Warning: array_unshift() expects at least 2 parameters, 1 given in %s on line %d 33NULL 34Done 35