import zend standard tests
[hiphop-php.git] / hphp / test / zend / good / ext-standard-array / array_intersect_key_variation4.php
blob6405eeafc0e0ec83c752c5fc9bc485509d917b95
1 <?php
2 /* Prototype : array array_intersect_key(array arr1, array arr2 [, array ...])
3 * Description: Returns the entries of arr1 that have keys which are present in all the other arguments.
4 * Source code: ext/standard/array.c
5 */
7 echo "*** Testing array_intersect_key() : usage variation ***\n";
9 // Initialise function arguments not being substituted (if any)
10 $input_array = array(0 => '0', -1 => '-1' , 02 => 'two', -07 => '-07', 0xA => '0xA', -0xC => '-0xc');
12 $input_arrays = array(
13 'decimal indexed' => array(10 => '10', '-17' => '-17'),
14 'octal indexed' => array(-011 => '-011', 012 => '012'),
15 'hexa indexed' => array(0x12 => '0x12', -0x7 => '-0x7', ),
18 foreach($input_arrays as $key =>$value) {
19 echo "\n--$key--\n";
20 var_dump( array_intersect_key($input_array, $value) );
21 var_dump( array_intersect_key($value,$input_array ) );
24 ===DONE===