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