3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class myClass { function abc() { $callback = function(){ //Here is the syntax error return 'Hello world!<br>'; } return $GLOBALS['otherClass']->birds($callback); } } class otherClass { function birds($callback) { return $callback(); } } $GLOBALS['otherClass'] = new otherClass(); $myClass = new myClass(); echo $myClass->abc(); echo $myClass->abc();
Output for 5.4.0 - 5.4.11
Parse error: syntax error, unexpected 'return' (T_RETURN) in /in/GiFIK on line 9
Process exited with code 255.
Output for 5.3.0 - 5.3.21
Parse error: syntax error, unexpected T_RETURN in /in/GiFIK on line 9
Process exited with code 255.