Return to array_udiff_error.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / array |
1.1 misho 1: --TEST-- 2: Test 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: 11: echo "*** Testing array_udiff() : error conditions ***\n"; 12: 13: $arr1 = array(1, 2); 14: $arr2 = array(1, 2); 15: include('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 21: echo "\n-- Testing array_udiff() function with more than expected no. of arguments --\n"; 22: var_dump( array_udiff($arr1, $arr2, $data_comp_func, $extra_arg) ); 23: 24: // Testing array_udiff with one less than the expected number of arguments 25: echo "\n-- Testing array_udiff() function with less than expected no. of arguments --\n"; 26: var_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: 35: Warning: array_udiff() expects parameter 4 to be a valid callback, no array or string given in %sarray_udiff_error.php on line %d 36: NULL 37: 38: -- Testing array_udiff() function with less than expected no. of arguments -- 39: 40: Warning: array_udiff(): at least 3 parameters are required, 2 given in %sarray_udiff_error.php on line %d 41: NULL 42: ===DONE===