import zend standard tests
[hiphop-php.git] / hphp / test / zend / good / ext-standard-array / array_diff_assoc_variation8.php
blobb093648c52ef23d097e3508a669727ed9bd39715
1 <?php
2 /* Prototype : array array_diff_assoc(array $arr1, array $arr2 [, array ...])
3 * Description: Returns the entries of $arr1 that have values which are not
4 * present in any of the others arguments but do additional checks whether
5 * the keys are equal
6 * Source code: ext/standard/array.c
7 */
9 /*
10 * Test how array_diff_assoc() behaves when comparing:
11 * 1. the order of the array
12 * 2. duplicate values
13 * 3. duplicate key names
16 echo "*** Testing array_diff_assoc() : variation ***\n";
18 $array_index = array('a', 'b', 'c', 0 => 'd', 'b'); //duplicate key (0), duplicate value (b)
19 $array_assoc = array ('2' => 'c', //same key=>value pair, different order
20 '1' => 'b',
21 '0' => 'a',
22 'b' => '3', //key and value from array_index swapped
23 'c' => 2); //same as above, using integer
25 var_dump(array_diff_assoc($array_index, $array_assoc));
26 var_dump(array_diff_assoc($array_assoc, $array_index));
28 echo "Done";