3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function f($var){ // not using references foreach($var as $k => $v){ unset($var[$k]); // shouldn't this unset from a copy?! } } print gettype($GLOBALS); f($GLOBALS); print gettype($GLOBALS);
Output for 5.0.4 - 5.6.28, 7.0.0 - 7.1.0
array Notice: Undefined variable: GLOBALS in /in/5XuO4 on line 11 NULL
Output for hhvm-3.10.0 - 3.12.0
arrayNULL
Output for 4.3.0 - 5.0.3
array Notice: Undefined variable: GLOBALS in /in/5XuO4 on line 11 NULL