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() use($var)); } } $foo = new foo; $foo->bar();
Output for 5.4.0 - 5.4.10
Parse error: syntax error, unexpected 'use' (T_USE) in /in/TW4LI on line 9
Process exited with code 255.
Output for 5.3.0 - 5.3.20
Parse error: syntax error, unexpected T_USE in /in/TW4LI on line 9
Process exited with code 255.