1--TEST--
2Test uksort() function : error conditions
3--FILE--
4<?php
5/* Prototype  : bool uksort(array array_arg, string cmp_function)
6 * Description: Sort an array by keys using a user-defined comparison function
7 * Source code: ext/standard/array.c
8 * Alias to functions:
9 */
10
11echo "*** Testing uksort() : error conditions ***\n";
12
13echo "\n-- Testing uksort() function with more than expected no. of arguments --\n";
14$array_arg = array(1, 2);
15$cmp_function = 'string_val';
16$extra_arg = 10;
17var_dump( uksort($array_arg, $cmp_function, $extra_arg) );
18
19echo "\n-- Testing uksort() function with less than expected no. of arguments --\n";
20$array_arg = array(1, 2);
21var_dump( uksort($array_arg) );
22
23echo "\n-- Testing uksort() function with zero arguments --\n";
24var_dump( uksort() );
25
26?>
27===DONE===
28--EXPECTF--
29*** Testing uksort() : error conditions ***
30
31-- Testing uksort() function with more than expected no. of arguments --
32
33Warning: uksort() expects exactly 2 parameters, 3 given in %suksort_error.php on line %d
34NULL
35
36-- Testing uksort() function with less than expected no. of arguments --
37
38Warning: uksort() expects exactly 2 parameters, 1 given in %suksort_error.php on line %d
39NULL
40
41-- Testing uksort() function with zero arguments --
42
43Warning: uksort() expects exactly 2 parameters, 0 given in %suksort_error.php on line %d
44NULL
45===DONE===
46