global statement removal: hphp/test [7/x]
[hiphop-php.git] / hphp / test / quick / undefined_is_type.php
blob20df9fe28e9e0afc11d30cada2d9ab4b655f9145
1 <?hh
3 function foo() {
4 // Force all the types to be in so these don't get constant folded.
5 if (isset($GLOBALS['a'])) $a = 1;
6 if (isset($GLOBALS['b'])) $a = 1.2;
7 if (isset($GLOBALS['c'])) $a = '1';
8 if (isset($GLOBALS['d'])) $a = new stdclass;
9 if (isset($GLOBALS['e'])) $a = array();
10 if (isset($GLOBALS['f'])) $a = false;
11 if (isset($GLOBALS['g'])) $a = null;
13 echo "set: ", isset($a) . "\n";
14 echo "nul: ", is_null($a) . "\n";
15 echo "str: ", is_string($a) . "\n";
16 echo "obj: ", is_object($a) . "\n";
17 echo "arr: ", is_array($a) . "\n";
18 echo "int: ", is_int($a) . "\n";
19 echo "integer: ", is_integer($a) . "\n";
20 echo "long: ", is_long($a) . "\n";
21 echo "real: ", is_real($a) . "\n";
22 echo "double: ", is_double($a) . "\n";
23 echo "float: ", is_float($a) . "\n";
24 echo "bool: ", is_bool($a) . "\n";
27 foo();