usleep() Validates Its Microseconds Argument Range
usleep()’s $microseconds argument is passed to the operating system as an unsigned integer. Until PHP 8.6, a value greater than UINT_MAX (4294967295) silently overflowed, which could make the function sleep for a much shorter time than requested. In PHP 8.6, a value greater than UINT_MAX throws a ValueError instead.
PHP code
<?php
try {
var_dump(usleep(4294967296));
} catch (\ValueError $e) {
echo "ValueError: ".$e->getMessage()."\n";
}
?>
Before
NULL
After
ValueError: usleep(): Argument #1 ($microseconds) must be between 0 and 4294967295
PHP version change
This behavior changed in 8.6.