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