1--TEST-- 2Test array_intersect_key() function : usage variation - Passing integer indexed array 3--FILE-- 4<?php 5echo "*** Testing array_intersect_key() : usage variation ***\n"; 6 7// Initialise function arguments not being substituted (if any) 8$input_array = array(0 => '0', -1 => '-1' , 02 => 'two', -07 => '-07', 0xA => '0xA', -0xC => '-0xc'); 9 10$input_arrays = array( 11 'decimal indexed' => array(10 => '10', '-17' => '-17'), 12 'octal indexed' => array(-011 => '-011', 012 => '012'), 13 'hexa indexed' => array(0x12 => '0x12', -0x7 => '-0x7', ), 14); 15 16foreach($input_arrays as $key =>$value) { 17 echo "\n--$key--\n"; 18 var_dump( array_intersect_key($input_array, $value) ); 19 var_dump( array_intersect_key($value,$input_array ) ); 20} 21?> 22--EXPECT-- 23*** Testing array_intersect_key() : usage variation *** 24 25--decimal indexed-- 26array(1) { 27 [10]=> 28 string(3) "0xA" 29} 30array(1) { 31 [10]=> 32 string(2) "10" 33} 34 35--octal indexed-- 36array(1) { 37 [10]=> 38 string(3) "0xA" 39} 40array(1) { 41 [10]=> 42 string(3) "012" 43} 44 45--hexa indexed-- 46array(1) { 47 [-7]=> 48 string(3) "-07" 49} 50array(1) { 51 [-7]=> 52 string(4) "-0x7" 53} 54