3v4l.org

run code in 200+ 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 '<pre>'; print gettype($GLOBALS); f($GLOBALS); print gettype($GLOBALS);
Output for 5.0.4 - 7.1.7
<pre>array Notice: Undefined variable: GLOBALS in /in/5eNBa on line 12 NULL
Output for 4.3.0 - 5.0.3
<pre>array Notice: Undefined variable: GLOBALS in /in/5eNBa on line 12 NULL