Underflow¶
Underflow happens when a value goes below a limit: out of its range of existence, the behavior of the value is now unknown.
Underflow happens with integers, which are limited from PHP_INT_MIN to PHP_INT_MIN, floats, which are limited from PHP_FLOAT_MIN to PHP_FLOAT_MAX.
Other situations, such as accessing an array element or a string character beyond its first element, defaults to returning null.
<?php
$a = PHP_INT_MAX;
$b = (int) ($a + 1);
echo $a.PHP_EOL;
echo $b;
?>
See also PHP-FPM Underflow RCE and Integer Underflow.
Related : Null, Overflow, RangeException