sleep() Validates Its Seconds Argument Range
sleep()’s $seconds 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, or not at all. In PHP 8.6, a value greater than UINT_MAX throws a ValueError instead.
PHP code
<?php
try {
var_dump(sleep(4294967296));
} catch (\ValueError $e) {
echo "ValueError: ".$e->getMessage()."\n";
}
?>
Before
int(0)
After
ValueError: sleep(): Argument #1 ($seconds) must be between 0 and 4294967295
PHP version change
This behavior changed in 8.6.