import zend standard tests
[hiphop-php.git] / hphp / test / zend / good / ext-standard-array / 008.php.expectf
blob48b40f88d852aea85579244fe6ec6f0e05fee6f3
1 -=-=-=-=-=-=-=-=-=-= TEST 1 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
2 $a=array (
3   0 => 1,
4   'big' => 2,
5   1 => 2,
6   2 => 6,
7   3 => 3,
8   4 => 5,
9   5 => 3,
10   6 => 3,
11   7 => 454,
12   8 => 'some_string',
13   9 => 3,
14   10 => 3,
15   11 => 3,
16   12 => 3,
17   13 => 3,
18   14 => 3,
19   15 => 3,
20   16 => 3,
21   17 => 17,
23 $b=array (
24   0 => 2,
25   1 => 2,
26   2 => 3,
27   3 => 3,
28   4 => 3,
29   5 => 3,
30   6 => 3,
31   7 => 3,
32   8 => 3,
33   9 => 3,
34   10 => 3,
35   11 => 3,
36   12 => 3,
37   13 => 3,
38   14 => 3,
39   15 => 17,
40   16 => 25,
41   17 => 'some_string',
42   18 => 7,
43   19 => 8,
44   20 => 9,
45   21 => 109,
46   22 => 78,
47   23 => 17,
49 $c=array (
50   0 => -1,
51   1 => 2,
52   2 => 1,
53   3 => 15,
54   4 => 25,
55   5 => 17,
57 array_intersect($a,$b,$c);
58 array(3) {
59   ["big"]=>
60   int(2)
61   [1]=>
62   int(2)
63   [17]=>
64   int(17)
66 array_intersect_assoc($a,$b,$c);
67 array(1) {
68   [1]=>
69   int(2)
71 array_intersect($a,$b);
72 array(15) {
73   ["big"]=>
74   int(2)
75   [1]=>
76   int(2)
77   [3]=>
78   int(3)
79   [5]=>
80   int(3)
81   [6]=>
82   int(3)
83   [8]=>
84   string(11) "some_string"
85   [9]=>
86   int(3)
87   [10]=>
88   int(3)
89   [11]=>
90   int(3)
91   [12]=>
92   int(3)
93   [13]=>
94   int(3)
95   [14]=>
96   int(3)
97   [15]=>
98   int(3)
99   [16]=>
100   int(3)
101   [17]=>
102   int(17)
104 array_intersect_assoc($a,$b);
105 array(10) {
106   [1]=>
107   int(2)
108   [3]=>
109   int(3)
110   [5]=>
111   int(3)
112   [6]=>
113   int(3)
114   [9]=>
115   int(3)
116   [10]=>
117   int(3)
118   [11]=>
119   int(3)
120   [12]=>
121   int(3)
122   [13]=>
123   int(3)
124   [14]=>
125   int(3)
127 -=-=-=-=-=-=-=-=-=-= TEST 2 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
128 $a=array (
129   'a' => 2,
130   'b' => 'some',
131   'c' => 'done',
132   'z' => 'foo',
133   'f' => 5,
134   'fan' => 'fen',
135   'bad' => 'bed',
136   'gate' => 'web',
137   7 => 18,
138   9 => 25,
139   11 => 42,
140   12 => 42,
141   45 => 42,
142   73 => 'foo',
143   95 => 'some',
144   'som3' => 'some',
145   'want' => 'wanna',
147 $b=array (
148   'a' => 7,
149   7 => 18,
150   9 => 13,
151   11 => 42,
152   45 => 46,
153   'som3' => 'some',
154   'foo' => 'some',
155   'goo' => 'foo',
156   'f' => 5,
157   'z' => 'equal',
158   'gate' => 'web',
160 $c=array (
161   'gate' => 'web',
162   73 => 'foo',
163   95 => 'some',
167 Results:
169 array_intersect($a,$b,$c);
170 array(6) {
171   ["b"]=>
172   string(4) "some"
173   ["z"]=>
174   string(3) "foo"
175   ["gate"]=>
176   string(3) "web"
177   [73]=>
178   string(3) "foo"
179   [95]=>
180   string(4) "some"
181   ["som3"]=>
182   string(4) "some"
184 array_intersect_assoc($a,$b,$c);
185 array(1) {
186   ["gate"]=>
187   string(3) "web"
189 array_intersect($a,$b);
190 array(11) {
191   ["b"]=>
192   string(4) "some"
193   ["z"]=>
194   string(3) "foo"
195   ["f"]=>
196   int(5)
197   ["gate"]=>
198   string(3) "web"
199   [7]=>
200   int(18)
201   [11]=>
202   int(42)
203   [12]=>
204   int(42)
205   [45]=>
206   int(42)
207   [73]=>
208   string(3) "foo"
209   [95]=>
210   string(4) "some"
211   ["som3"]=>
212   string(4) "some"
214 array_intersect_assoc($a,$b);
215 array(5) {
216   ["f"]=>
217   int(5)
218   ["gate"]=>
219   string(3) "web"
220   [7]=>
221   int(18)
222   [11]=>
223   int(42)
224   ["som3"]=>
225   string(4) "some"