3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function foo() { eval("function bar() {throw new exception();} bar();"); } try { foo(); } catch (exception $e) { var_dump($e->getTraceAsString()); }
based on emj40
Output for 5.0.0 - 5.0.2, 5.0.5 - 5.6.28, 7.0.0 - 7.1.0
string(99) "#0 /in/TNVeT(6) : eval()'d code(1): bar() #1 /in/TNVeT(6): eval() #2 /in/TNVeT(11): foo() #3 {main}"
Output for hhvm-3.10.0 - 3.12.0
string(136) "#0 /in/TNVeT(6)(a3d73d9a4ee624fa9b881c0b1da6f5b1) : eval()'d code(1): bar() #1 /in/TNVeT(6): include() #2 /in/TNVeT(11): foo() #3 {main}"
Output for 5.0.3 - 5.0.4
string(141) "#0 /in/TNVeT(6) : eval()'d code(1): bar() #1 /in/TNVeT(6) : eval()'d code(1): bar() #2 /in/TNVeT(6): eval() #3 /in/TNVeT(11): foo() #4 {main}"
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/TNVeT on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '{' in /in/TNVeT on line 10
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/TNVeT on line 10
Process exited with code 255.