1--TEST--
2Test array_udiff_uassoc() function : error conditions
3--FILE--
4<?php
5/* Prototype  : array array_udiff_uassoc(array arr1, array arr2 [, array ...], callback data_comp_func, 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 and elements are compared by user supplied functions.
7 * Source code: ext/standard/array.c
8 * Alias to functions:
9 */
10
11echo "*** Testing array_udiff_uassoc() : error conditions ***\n";
12
13
14$arr1 = array(1, 2);
15$arr2 = array(1, 2);
16
17include('compare_function.inc');
18$data_comp_func = 'compare_function';
19$key_comp_func = 'compare_function';
20$extra_arg = 10;
21
22//Test array_udiff_uassoc with one more than the expected number of arguments
23echo "\n-- Testing array_udiff_uassoc() function with more than expected no. of arguments --\n";
24var_dump( array_udiff_uassoc($arr1, $arr2, $data_comp_func, $key_comp_func, $extra_arg) );
25
26// Testing array_udiff_uassoc with one less than the expected number of arguments
27echo "\n-- Testing array_udiff_uassoc() function with less than expected no. of arguments --\n";
28var_dump( array_udiff_uassoc($arr1, $arr2, $data_comp_func) );
29
30?>
31===DONE===
32--EXPECTF--
33*** Testing array_udiff_uassoc() : error conditions ***
34
35-- Testing array_udiff_uassoc() function with more than expected no. of arguments --
36
37Warning: array_udiff_uassoc() expects parameter 5 to be a valid callback, no array or string given in %sarray_udiff_uassoc_error.php on line %d
38NULL
39
40-- Testing array_udiff_uassoc() function with less than expected no. of arguments --
41
42Warning: array_udiff_uassoc(): at least 4 parameters are required, 3 given in %sarray_udiff_uassoc_error.php on line %d
43NULL
44===DONE===
45