3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php try { echo 50/0; } catch (Exception $e) { echo "Exception caught!"; } catch (Throwable $e) { echo " Throwable caught!"; } catch (Error $e) { echo "Error caught!"; } catch (DivisionByZeroError $e) { echo "DivisionByZeroError caught!"; }
based on q2K52
Output for hhvm-3.11.1 - 3.21.3, 7.0.0 - 7.3.5
Warning: Division by zero in /in/ru5gu on line 3 INF
Output for hhvm-3.22.0
Warning: Division by zero in /in/ru5gu on line -1 INF
Output for 5.1.0 - 5.6.40, hhvm-3.10.1
Warning: Division by zero in /in/ru5gu on line 3
Output for 5.0.0 - 5.0.5
Warning: Division by zero in /in/ru5gu on line 3 Fatal error: Class 'Throwable' not found in /in/ru5gu on line 6
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/ru5gu on line 2
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/ru5gu on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/ru5gu on line 2
Process exited with code 255.