3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $foo = (function() { return function($a) { return $a + 42; }; })(); $bar = $foo(10); echo $bar(5);
based on EdHkF
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Function name must be a string in /in/E5cQb:9 Stack trace: #0 {main} thrown in /in/E5cQb on line 9
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Parse error: syntax error, unexpected '(' in /in/E5cQb on line 6
Process exited with code 255.