1--TEST--
2Test array_unique() function : error conditions
3--FILE--
4<?php
5/* Prototype  : array array_unique(array $input)
6 * Description: Removes duplicate values from array
7 * Source code: ext/standard/array.c
8*/
9
10echo "*** Testing array_unique() : error conditions ***\n";
11
12// Zero arguments
13echo "\n-- Testing array_unique() function with zero arguments --\n";
14var_dump( array_unique() );
15
16//Test array_unique with one more than the expected number of arguments
17echo "\n-- Testing array_unique() function with more than expected no. of arguments --\n";
18$input = array(1, 2);
19$extra_arg = 10;
20var_dump( array_unique($input, SORT_NUMERIC, $extra_arg) );
21
22echo "Done";
23?>
24--EXPECTF--
25*** Testing array_unique() : error conditions ***
26
27-- Testing array_unique() function with zero arguments --
28
29Warning: array_unique() expects at least 1 parameter, 0 given in %s on line %d
30NULL
31
32-- Testing array_unique() function with more than expected no. of arguments --
33
34Warning: array_unique() expects at most 2 parameters, 3 given in %s on line %d
35NULL
36Done
37