1--TEST-- 2Test array_intersect_key() function : usage variation - Passing float indexed array 3--FILE-- 4<?php 5/* Prototype : array array_intersect_key(array arr1, array arr2 [, array ...]) 6 * Description: Returns the entries of arr1 that have keys which are present in all the other arguments. 7 * Source code: ext/standard/array.c 8 */ 9 10echo "*** Testing array_intersect_key() : usage variation ***\n"; 11 12// Initialise function arguments not being substituted (if any) 13$input_array = array(0 => '0', 10 => '10' , -10 => '-10'); 14$float_indx_array = array(0.0 => '0.0', 10.5 => '10.5' , -10.5 => '-10.5', 0.5 => '0.5'); 15 16echo "\n-- Testing array_intersect_key() function with float indexed array --\n"; 17var_dump( array_intersect_key($input_array, $float_indx_array) ); 18var_dump( array_intersect_key($float_indx_array,$input_array ) ); 19?> 20===DONE=== 21--EXPECTF-- 22*** Testing array_intersect_key() : usage variation *** 23 24-- Testing array_intersect_key() function with float indexed array -- 25array(3) { 26 [0]=> 27 string(1) "0" 28 [10]=> 29 string(2) "10" 30 [-10]=> 31 string(3) "-10" 32} 33array(3) { 34 [0]=> 35 string(3) "0.5" 36 [10]=> 37 string(4) "10.5" 38 [-10]=> 39 string(5) "-10.5" 40} 41===DONE=== 42