Return to array_push_error1.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / array |
1.1 misho 1: --TEST-- 2: Test array_push() function : error conditions - Pass incorrect number of args 3: --FILE-- 4: <?php 5: /* Prototype : int array_push(array $stack, mixed $var [, mixed $...]) 6: * Description: Pushes elements onto the end of the array 7: * Source code: ext/standard/array.c 8: */ 9: 10: /* 11: * Pass incorrect number of arguments to array_push() to test behaviour 12: */ 13: 14: echo "*** Testing array_push() : error conditions ***\n"; 15: 16: // Testing array_push with one less than the expected number of arguments 17: echo "\n-- Testing array_push() function with less than expected no. of arguments --\n"; 18: $stack = array(1, 2); 19: var_dump( array_push($stack) ); 20: 21: echo "Done"; 22: ?> 23: --EXPECTF-- 24: *** Testing array_push() : error conditions *** 25: 26: -- Testing array_push() function with less than expected no. of arguments -- 27: 28: Warning: array_push() expects at least 2 parameters, 1 given in %s on line %d 29: NULL 30: Done