3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php set_error_handler(function ($err_severity, $err_msg, $err_file, $err_line, array $err_context) { throw new Exception(); }); $grade = 10; try { $grade = $grade % 0; } catch (Exception $e) { $grade = 0; } var_dump($grade);
based on M9FtM
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught DivisionByZeroError: Modulo by zero in /in/9hs7J:9 Stack trace: #0 {main} thrown in /in/9hs7J on line 9
Process exited with code 255.
Output for 5.3.20 - 5.6.28
int(0)