1--TEST--
2Test 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
14echo "*** Testing array_push() : error conditions ***\n";
15
16// Testing array_push with one less than the expected number of arguments
17echo "\n-- Testing array_push() function with less than expected no. of arguments --\n";
18$stack = array(1, 2);
19var_dump( array_push($stack) );
20
21echo "Done";
22?>
23--EXPECTF--
24*** Testing array_push() : error conditions ***
25
26-- Testing array_push() function with less than expected no. of arguments --
27
28Warning: array_push() expects at least 2 parameters, 1 given in %s on line %d
29NULL
30Done
31