1--TEST--
2Test array_diff() function : error conditions - too few arguments passed to function
3--FILE--
4<?php
5/* Prototype  : array array_diff(array $arr1, array $arr2 [, array ...])
6 * Description: Returns the entries of $arr1 that have values which are
7 * not present in any of the others arguments.
8 * Source code: ext/standard/array.c
9 */
10
11/*
12 * Test array_diff with less than the expected number of arguments
13 */
14
15echo "*** Testing array_diff() : error conditions ***\n";
16// Zero arguments
17echo "\n-- Testing array_diff() function with zero arguments --\n";
18var_dump( array_diff() );
19
20
21// Testing array_diff with one less than the expected number of arguments
22echo "\n-- Testing array_diff() function with less than expected no. of arguments --\n";
23$arr1 = array(1, 2);
24var_dump( array_diff($arr1) );
25
26echo "Done";
27?>
28--EXPECTF--
29*** Testing array_diff() : error conditions ***
30
31-- Testing array_diff() function with zero arguments --
32
33Warning: array_diff(): at least 2 parameters are required, 0 given in %s on line %d
34NULL
35
36-- Testing array_diff() function with less than expected no. of arguments --
37
38Warning: array_diff(): at least 2 parameters are required, 1 given in %s on line %d
39NULL
40Done
41