3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function foo($unset = false) { echo $bar; static $bar = 'bar'; echo $bar; if ($unset) { unset($bar); } } foo(); foo(true); foo();
Output for 5.0.4 - 7.2.0
Notice: Undefined variable: bar in /in/QZd2Z on line 4 bar Notice: Undefined variable: bar in /in/QZd2Z on line 4 bar Notice: Undefined variable: bar in /in/QZd2Z on line 4 bar
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: bar in /in/QZd2Z on line 4 bar Notice: Undefined variable: bar in /in/QZd2Z on line 4 bar Notice: Undefined variable: bar in /in/QZd2Z on line 4 bar