3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { public static function bar() { throw new Exception(); } } try { $a = array( 'a' => 'aa', 'b' => array( 'c' => Foo::bar(), ), ); } catch (Exception $e) { echo $e, PHP_EOL; }
Output for 7.0.0 - 7.1.0
Exception in /in/oVUhD:4 Stack trace: #0 /in/oVUhD(11): Foo::bar() #1 {main}
Output for hhvm-3.12.0
exception 'Exception' with message '' in /in/oVUhD:-1 Stack trace: #0 /in/oVUhD(2): Foo::bar() #1 {main}
Output for hhvm-3.10.0
exception 'Exception' with message '' in /in/oVUhD:4 Stack trace: #0 /in/oVUhD(11): Foo::bar() #1 {main}
Output for 5.0.2, 5.0.5 - 5.6.28
exception 'Exception' in /in/oVUhD:4 Stack trace: #0 /in/oVUhD(11): Foo::bar() #1 {main}
Output for 5.0.3 - 5.0.4
exception 'Exception' in /in/oVUhD:4 Stack trace: #0 /in/oVUhD(4): Foo::bar() #1 /in/oVUhD(11): Foo::bar() #2 {main}
Output for 5.0.0 - 5.0.1
exception 'Exception' in /in/oVUhD:4 Stack trace: #0 /in/oVUhD(11): Foo::bar() #1 {main} Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/oVUhD on line 15 PHP_EOL
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/oVUhD on line 3
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_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/oVUhD on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/oVUhD on line 3
Process exited with code 255.