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