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