<?php
try {
intdiv(PHP_INT_MIN, -1);
} catch (Error $e) {
echo get_class($e), ': ', $e->getMessage(), PHP_EOL;
}
try {
intdiv(1, 0);
} catch (Error $e) {
echo get_class($e), ': ', $e->getMessage(), PHP_EOL;
}
?>
The above example will output:
ArithmeticError: Division of PHP_INT_MIN by -1 is not an integer
DivisionByZeroError: Division by zero