remove array_multisort and convert array_multisortN to use inout
[hiphop-php.git] / hphp / test / zend / good / ext / standard / tests / array / array_flip_variation5.php
blob7c03e978eb52e51691d636c1e84cdfbb32564c85
1 <?hh
2 /* Prototype : array array_flip(array $input)
3 * Description: Return array with key <-> value flipped
4 * Source code: ext/standard/array.c
5 */
7 /*
8 * Using different types of repeatitive keys as well as values for 'input' array
9 */
10 <<__EntryPoint>> function main(): void {
11 echo "*** Testing array_flip() : 'input' array with repeatitive keys/values ***\n";
13 // array with numeric key repeatition
14 $input = array(1 => 'value', 2 => 'VALUE', 1 => "VaLuE", 3.4 => 4, 3.4 => 5);
15 var_dump( array_flip($input) );
17 // array with string key repeatition
18 $input = array("key" => 1, "two" => 'TWO', 'three' => 3, 'key' => "FOUR");
19 var_dump( array_flip($input) );
21 // array with bool key repeatition
22 $input = array(true => 1, false => 0, TRUE => -1);
23 var_dump( array_flip($input) );
25 // array with null key repeatition
26 $input = array(null => "Hello", NULL => 0);
27 var_dump( array_flip($input) );
29 // array with numeric value repeatition
30 $input = array('one' => 1, 'two' => 2, 3 => 1, "index" => 1);
31 var_dump( array_flip($input) );
33 //array with string value repeatition
34 $input = array('key1' => "value1", "key2" => '2', 'key3' => 'value1');
35 var_dump( array_flip($input) );
37 echo "Done";