remove array_multisort and convert array_multisortN to use inout
[hiphop-php.git] / hphp / test / zend / good / ext / standard / tests / array / array_diff_variation6.php
blob086d5fc55b656964aab9b61dafd04ae94e2e0f5f
1 <?hh
2 /* Prototype : array array_diff(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.
5 * Source code: ext/standard/array.c
6 */
8 /*
9 * Test that array_diff behaves as expected for comparing:
10 * 1. the order of the array
11 * 2. duplicate values
12 * 3. duplicate key names
14 <<__EntryPoint>> function main(): void {
15 echo "*** Testing array_diff() : usage variations ***\n";
17 $array_index = array('a', 'b', 'c', 0 => 'd', 'b'); //duplicate key (0), duplicate value (b)
18 $array_assoc = array ('2' => 'c', //same key=>value pair, different order
19 '1' => 'b',
20 '0' => 'a',
21 'b' => '3', //key and value from array_index swapped
22 'c' => 2); //same as above, using integer
24 var_dump(array_diff($array_index, $array_assoc));
25 var_dump(array_diff($array_assoc, $array_index));
27 echo "Done";