3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php global $arr; $arr = array(1,2,4); foreach($arr as $a) { echo $a; } unset($arr); foreach($arr as $a) { echo $a; }
Output for 5.1.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
124 Notice: Undefined variable: arr in /in/Bo28m on line 11 Warning: Invalid argument supplied for foreach() in /in/Bo28m on line 11
Output for 4.3.0 - 4.3.10, 4.4.0 - 5.0.5
124 Warning: Invalid argument supplied for foreach() in /in/Bo28m on line 11
Output for 4.3.11
124