2 /* Prototype : array array_diff_ukey(array arr1, array arr2 [, array ...], callback key_comp_func)
3 * Description: Returns the entries of arr1 that have keys which are not present in any of the others arguments.
4 * Source code: ext/standard/array.c
7 echo "*** Testing array_diff_ukey() : error conditions ***\n";
10 $array1 = array('blue' => 1, 'red' => 2, 'green' => 3, 'purple' => 4);
11 $array2 = array('green' => 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8);
14 function key_compare_func($key1, $key2)
19 return ($key1 > $key2)?
1:-1;
22 //Test array_diff_ukey with one more than the expected number of arguments
23 echo "\n-- Testing array_diff_ukey() function with more than expected no. of arguments --\n";
24 var_dump( array_diff_ukey($array1, $array2, 'key_compare_func', $extra_arg) );
26 // Testing array_diff_ukey with one less than the expected number of arguments
27 echo "\n-- Testing array_diff_ukey() function with less than expected no. of arguments --\n";
28 var_dump( array_diff_ukey($array1, $array2) );
30 // Testing array_diff_ukey with one less than the expected number of arguments
31 echo "\n-- Testing array_diff_ukey() function with no arguments --\n";
32 var_dump( array_diff_ukey() );