Revert "make hphpc able to use ini files"
[hiphop-php.git] / hphp / test / zend / bad / ext / standard / tests / array / array_intersect_variation9.php
blob6af41e25b83d033a8ea3c7a74536080f9250cf18
1 <?php
2 /* Prototype : array array_intersect(array $arr1, array $arr2 [, array $...])
3 * Description: Returns the entries of arr1 that have values which are present in all the other arguments
4 * Source code: ext/standard/array.c
5 */
7 /*
8 * Testing the behavior of array_intersect() by passing 2-D arrays
9 * to both $arr1 and $arr2 argument.
10 * Optional argument takes the same value as that of $arr1
13 echo "*** Testing array_intersect() : passing two dimensional array to both \$arr1 and \$arr2 arguments ***\n";
15 // two dimensional arrays for $arr1 and $arr2 argument
16 $arr1 = array (
18 // arrays with default keys
19 array(1, 2, "hello", 'world'),
20 array(1, 2, 3, 4),
22 // arrays with explicit keys
23 array(1 => "one", 2 => "two", 3 => "three"),
24 array("ten" => 10, "twenty" => 20.00, "thirty" => 30)
25 );
27 $arr2 = array (
28 array(1, 2, 3, 4),
29 array(1 => "one", 2 => "two", 3 => "three")
32 /* Passing the entire array as argument to $arr1 and $arr2 */
33 // Calling array_intersect() with default arguments
34 echo "-- Passing the entire 2-D array to \$arr1 and \$arr2 --\n";
35 echo "- With default arguments -\n";
36 var_dump( array_intersect($arr1, $arr2) );
38 // Calling array_intersect() with more arguments
39 // additional argument passed is the same as $arr1
40 echo "- With more arguments -\n";
41 var_dump( array_intersect($arr1, $arr2, $arr1) );
43 /* Passing the sub-array as argument to $arr1 and $arr2 */
44 // Calling array_intersect() with default arguments
45 echo "-- Passing the sub-array to \$arr1 and \$arr2 --\n";
46 echo "- With default arguments -\n";
47 var_dump( array_intersect($arr1[0], $arr2[0]) );
49 // Calling array_intersect() with more arguments
50 // additional argument passed is the same as $arr1
51 echo "- With more arguments -\n";
52 var_dump( array_intersect($arr1[0], $arr2[0], $arr1[0]) );
54 echo "Done";