Roll back array-specific changes through D19607758
[hiphop-php.git] / hphp / test / slow / is-list-like.php
blobc15d471478772f5fe4080e4080569fce78278200
1 <?hh
2 // Copyright 2004-present Facebook. All Rights Reserved.
4 function test($x) {
5 $x = __hhvm_intrinsics\launder_value($x);
6 var_dump(HH\is_list_like($x));
9 <<__EntryPoint>> function test_all(): void {
10 test(null);
11 test(false);
12 test(true);
13 test(123);
14 test(3.141);
15 test('abc');
16 test(new stdclass);
18 test(__hhvm_intrinsics\dummy_cast_to_kindofarray(vec[]));
19 test(varray[]);
20 test(darray[]);
21 test(vec[]);
22 test(dict[]);
23 test(keyset[]);
25 test(__hhvm_intrinsics\dummy_cast_to_kindofarray(vec[1, 2, 3]));
26 test(__hhvm_intrinsics\dummy_cast_to_kindofarray(dict[0 => 'a', 1 => 'b']));
27 test(varray['a', 'b', 'c']);
28 test(darray[0 => 'a', 1 => 'b']);
29 test(vec['a', 'b', 'c']);
30 test(dict[0 => 'a', 1 => 'b']);
31 test(keyset[0, 1]);
33 test(__hhvm_intrinsics\dummy_cast_to_kindofarray(dict['a' => 100, 'b' => 200]));
34 test(darray['a' => 100, 'b' => 200]);
35 test(dict['a' => 100, 'b' => 200]);
36 test(keyset[0, 100]);