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