3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class foo { function bar() { $var = array(); $closure1 = function(){return $GLOBALS['var']}; $closure2 = function(){return $var}; print_r($closure1()); print_r($closure2()); } } $foo = new foo; $foo->bar();
Output for 5.3.0 - 5.4.10
Parse error: syntax error, unexpected '}' in /in/WlK0H on line 5
Process exited with code 255.