1--TEST--
2Test array_intersect_key() function : usage variation - Passing Multi dimensional array
3--FILE--
4<?php
5echo "*** Testing array_intersect_key() : usage variation ***\n";
6
7/// Initialise function arguments not being substituted (if any)
8$array1 = array(
9
10      'first' => array('blue'  => 1, 'red'  => 2),
11
12      'second' => array('yellow' => 7),
13
14      'third' => array(0 =>'zero'),
15);
16
17$array2 = array (
18
19      'first' => array('blue'  => 1, 'red'  => 2,),
20
21      'second' => array('cyan'   => 8),
22
23      'fourth' => array(2 => 'two'),
24);
25var_dump( array_intersect_key($array1, $array2) );
26var_dump( array_intersect_key($array2,$array1 ) );
27?>
28--EXPECT--
29*** Testing array_intersect_key() : usage variation ***
30array(2) {
31  ["first"]=>
32  array(2) {
33    ["blue"]=>
34    int(1)
35    ["red"]=>
36    int(2)
37  }
38  ["second"]=>
39  array(1) {
40    ["yellow"]=>
41    int(7)
42  }
43}
44array(2) {
45  ["first"]=>
46  array(2) {
47    ["blue"]=>
48    int(1)
49    ["red"]=>
50    int(2)
51  }
52  ["second"]=>
53  array(1) {
54    ["cyan"]=>
55    int(8)
56  }
57}
58