3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = 'echo __FILE__;'; $func = eval('return function() { '.$str.'; };'); $func();var_dump($func);exit;
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
/in/2vYTl(4) : eval()'d codeobject(Closure)#1 (0) { }
Output for hhvm-3.12.0
/in/2vYTl(4)(1858d7cba8fc48208f58960347b0f629) : eval()'d codeobject(Closure$;710604732$d878a8b62782dd8be68361cf1629058$)#1 (0) { }
Output for hhvm-3.10.0
/in/2vYTl(4)(1858d7cba8fc48208f58960347b0f629) : eval()'d codeobject(Closure$;710604732$6337beea3c5608735be7bd13e5888453$)#1 (0) { }
Output for 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/2vYTl(4) : eval()'d code on line 1 Fatal error: Function name must be a string in /in/2vYTl on line 5
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION in /in/2vYTl(4) : eval()'d code on line 1 Fatal error: Function name must be a string in /in/2vYTl on line 5
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Parse error: syntax error, unexpected T_FUNCTION in /in/2vYTl(4) : eval()'d code on line 1 Fatal error: Call to undefined function: () in /in/2vYTl on line 5
Process exited with code 255.
Output for 4.4.2 - 4.4.4
Parse error: syntax error, unexpected T_FUNCTION in /in/2vYTl(4) : eval()'d code on line 1 Fatal error: Call to undefined function: () in /in/2vYTl on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_FUNCTION in /in/2vYTl(4) : eval()'d code on line 1 Fatal error: Call to undefined function: () in /in/2vYTl on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/2vYTl(4) : eval()'d code on line 1 Fatal error: Call to undefined function: () in /in/2vYTl on line 5
Process exited with code 255.