Updating submodules
[hiphop-php.git] / hphp / test / slow / shuffle.php
blob6e65ee163a97933018d18bae32663b2b832d80d8
1 <?hh
2 // Copyright 2004-present Facebook. All Rights Reserved.
4 function test($a) {
5 var_dump(shuffle(inout $a));
6 var_dump($a);
10 <<__EntryPoint>>
11 function main_shuffle() {
12 srand(1234);
14 test(varray[]);
15 test(varray[1, 2, 3, 4, 5]);
16 test(darray[1 => 'a', 2 => 'b', 3 => 'c']);
18 test(vec[]);
19 test(vec[1, 2, 3, 4, 5]);
20 test(vec['a', 'b', 'c']);
22 test(dict[]);
23 test(dict[1 => 'a', 2 => 'b', 3 => 'c']);
24 test(dict['a' => 100, 'b' => 200, 'c' => 300]);
26 test(keyset[]);
27 test(keyset[1, 2, 3, 4, 5]);
28 test(keyset['a', 'b', 'c']);
30 test(null);
31 test(true);
32 test(false);
33 test(123);
34 test('abc');
35 test(3.14);
36 test(fopen(__FILE__, 'r'));
37 test(new stdClass);
38 test(Vector{1, 2, 3, 4});