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