global statement removal: hphp/test [7/x]
[hiphop-php.git] / hphp / test / quick / set_toarray_warn.php
blobbbc95ff0c63383c5b28a019ecc36114cd3996db9
1 <?hh
3 // Test that Set::toArray() raises a warning on a int/string collision.
5 function should_warn() {
6 var_dump((Set {1, 42, 13, '1', 'hello', 'world'})->toArray());
7 var_dump((Set {0, '0'})->toArray());
9 var_dump((Set {strval(PHP_INT_MAX), PHP_INT_MAX})->toArray());
11 $minInt = -PHP_INT_MAX - 1;
12 var_dump((Set {$minInt, strval($minInt)})->toArray());
15 function no_warn() {
16 var_dump((Set {-0, '-0'})->toArray());
17 var_dump((Set {13, '013'})->toArray());
20 function main() {
21 echo "WARN\n";
22 echo "-------------\n\n";
23 should_warn();
24 echo "\n";
25 echo "DON'T WARN\n";
26 echo "-------------\n\n";
27 no_warn();
30 main();