3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function handle($throw = FALSE) { try { try { throw new \LogicException('invalid xml'); } catch (\Exception $e) { throw new \LogicException('', 0, $e); // wrap } } catch (\LogicException $e) { echo "ok\n"; } catch (\Exception $e) { echo "ok\n"; } } try { handle(); } catch (\Exception $e) { die('FUCKING BUG'); } var_dump(__FILE__);
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
ok string(9) "/in/nkCqm"
Output for 5.1.2 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/nkCqm on line 7 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/nkCqm on line 9 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/nkCqm on line 10 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/nkCqm on line 13 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/nkCqm on line 16 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/nkCqm on line 23 Fatal error: Wrong parameters for Exception([string $exception [, long $code ]]) in /in/nkCqm on line 10
Process exited with code 255.
Output for 5.1.0 - 5.1.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/nkCqm on line 7 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/nkCqm on line 9 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/nkCqm on line 10 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/nkCqm on line 13 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/nkCqm on line 16 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/nkCqm on line 23 Fatal error: Wrong parameter count for exception([string $exception [, long $code ]]) in /in/nkCqm on line 10
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/nkCqm on line 7 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/nkCqm on line 9 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/nkCqm on line 10 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/nkCqm on line 13 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/nkCqm on line 16 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/nkCqm on line 23 Fatal error: Class 'LogicException' not found in /in/nkCqm on line 7
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/nkCqm 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 '{' in /in/nkCqm on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/nkCqm on line 5
Process exited with code 255.