1--TEST-- 2Test array_diff_ukey() function : usage variation - Passing integer indexed array 3--FILE-- 4<?php 5echo "*** Testing array_diff_ukey() : usage variation ***\n"; 6 7// Initialise function arguments not being substituted (if any) 8$input_array = array(-07 => '-07', 0xA => '0xA'); 9 10$input_arrays = array( 11 'decimal indexed' => array(10 => '10', '-17' => '-17'), 12 'octal indexed' => array(-011 => '-011', 012 => '012'), 13 'hexa indexed' => array(0x12 => '0x12', -0x7 => '-0x7', ), 14); 15 16function key_compare_func($key1, $key2) 17{ 18 return strcasecmp($key1, $key2); 19} 20 21foreach($input_arrays as $key =>$value) { 22 echo "\n--$key--\n"; 23 var_dump( array_diff_ukey($value, $input_array, 'key_compare_func') ); 24 var_dump( array_diff_ukey($input_array, $value, 'key_compare_func') ); 25} 26?> 27--EXPECT-- 28*** Testing array_diff_ukey() : usage variation *** 29 30--decimal indexed-- 31array(1) { 32 [-17]=> 33 string(3) "-17" 34} 35array(1) { 36 [-7]=> 37 string(3) "-07" 38} 39 40--octal indexed-- 41array(1) { 42 [-9]=> 43 string(4) "-011" 44} 45array(1) { 46 [-7]=> 47 string(3) "-07" 48} 49 50--hexa indexed-- 51array(1) { 52 [18]=> 53 string(4) "0x12" 54} 55array(1) { 56 [10]=> 57 string(3) "0xA" 58} 59