3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class foo { function bar() { $var = array(); $closure1 = function() use($GLOBALS['var']) {return $GLOBALS['var'];}; $closure2 = function() use($var) {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 '[', expecting ',' or ')' in /in/VcC9K on line 5
Process exited with code 255.