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 - 7.1.0
ok string(9) "/in/Shbm9"
Output for 5.1.2 - 5.2.17
Fatal error: Wrong parameters for Exception([string $exception [, long $code ]]) in /in/Shbm9 on line 10
Process exited with code 255.
Output for 5.1.0 - 5.1.1
Fatal error: Wrong parameter count for exception([string $exception [, long $code ]]) in /in/Shbm9 on line 10
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Class 'LogicException' not found in /in/Shbm9 on line 7
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/Shbm9 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/Shbm9 on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/Shbm9 on line 5
Process exited with code 255.