1--TEST-- 2Test array_diff_uassoc() function : usage variation - Comparing strings containing integers and float 3--FILE-- 4<?php 5echo "*** Testing array_diff_uassoc() : usage variation ***\n"; 6 7//Initialize variables 8$arr_string_int = array('1', '2'); 9$arr_string_float = array('0' => '1.00', '1.00' => '2.00'); 10 11function key_compare_func($key1, $key2) 12{ 13 if ($key1 === $key2) { 14 return 0; 15 } 16 return ($key1 > $key2)? 1:-1; 17} 18 19echo "\n-- Result of comparing strings containing integers and strings containing floating points --\n"; 20var_dump( array_diff_uassoc($arr_string_int, $arr_string_float, "key_compare_func") ); 21var_dump( array_diff_uassoc($arr_string_float, $arr_string_int, "key_compare_func") ); 22 23?> 24--EXPECT-- 25*** Testing array_diff_uassoc() : usage variation *** 26 27-- Result of comparing strings containing integers and strings containing floating points -- 28array(2) { 29 [0]=> 30 string(1) "1" 31 [1]=> 32 string(1) "2" 33} 34array(2) { 35 [0]=> 36 string(4) "1.00" 37 ["1.00"]=> 38 string(4) "2.00" 39} 40