3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function local(){ $x = 0; return function(){ $x += 1; return $x; }; } var_dump(local()());
based on eZYbO
Output for 7.0.0 - 7.2.0
Notice: Undefined variable: x in /in/3RvL6 on line 7 int(1)
Output for 5.3.21 - 5.6.28
Parse error: syntax error, unexpected '(' in /in/3RvL6 on line 12
Process exited with code 255.