3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php foreach(get_defined_vars()as $key => $v) { unset($GLOBALS[$key]); } unset($key, $v); $a=5; $b = 6; $count = count(get_defined_vars()); echo $count; $vars=array_slice($b, 1); var_dump($vars);
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
2 Warning: array_slice() expects parameter 1 to be array, integer given in /in/TC88q on line 17 NULL
Output for hhvm-3.10.0 - 3.12.0
2 Warning: Invalid operand type was used: array_slice expects an array or collection as argument 1 in /in/TC88q on line 17 NULL
Output for 5.2.6 - 5.3.29
Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 17 Warning: array_slice() expects parameter 1 to be array, integer given in /in/TC88q on line 17 NULL
Output for 5.0.4 - 5.2.5
Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 17 Warning: array_slice(): The first argument should be an array in /in/TC88q on line 17 NULL
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 Notice: Undefined variable: GLOBALS in /in/TC88q on line 6 17 Warning: array_slice(): The first argument should be an array in /in/TC88q on line 17 NULL
Output for 4.3.2 - 4.4.9
2 Warning: array_slice(): The first argument should be an array in /in/TC88q on line 17 NULL
Output for 4.3.0 - 4.3.1
2 Warning: array_slice() [http://www.php.net/function.array-slice]: The first argument should be an array in /in/TC88q on line 17 NULL