1--TEST--
2Test array_udiff_assoc() function : error conditions
3--FILE--
4<?php
5/* Prototype  : array array_udiff_assoc(array arr1, array arr2 [, array ...], callback key_comp_func)
6 * Description: Returns the entries of arr1 that have values which are not present in any of the others arguments but do additional checks whether the keys are equal. Keys are compared by user supplied function.
7 * Source code: ext/standard/array.c
8 * Alias to functions:
9 */
10
11echo "*** Testing array_udiff_assoc() : error conditions ***\n";
12
13$arr1 = array(1, 2);
14$arr2 = array(1, 2);
15$extra_arg = 10;
16include('compare_function.inc');
17$key_comp_func = 'compare_function';
18
19
20//Test array_udiff_assoc with one more than the expected number of arguments
21echo "\n-- Testing array_udiff_assoc() function with more than expected no. of arguments --\n";
22var_dump( array_udiff_assoc($arr1, $arr2, $key_comp_func, $extra_arg) );
23
24// Testing array_udiff_assoc with one less than the expected number of arguments
25echo "\n-- Testing array_udiff_assoc() function with less than expected no. of arguments --\n";
26var_dump( array_udiff_assoc($arr1, $arr2) );
27
28?>
29===DONE===
30--EXPECTF--
31*** Testing array_udiff_assoc() : error conditions ***
32
33-- Testing array_udiff_assoc() function with more than expected no. of arguments --
34
35Warning: array_udiff_assoc() expects parameter 4 to be a valid callback, no array or string given in %sarray_udiff_assoc_error.php on line %d
36NULL
37
38-- Testing array_udiff_assoc() function with less than expected no. of arguments --
39
40Warning: array_udiff_assoc(): at least 3 parameters are required, 2 given in %sarray_udiff_assoc_error.php on line %d
41NULL
42===DONE===