Merge branch 'PHP-7.4'

This commit is contained in:
Nikita Popov 2019-06-22 10:20:12 +02:00
commit 98d05389a7

View file

@ -12,7 +12,8 @@ Michele Orselli mo@ideato.it
--FILE--
<?php
$time = microtime(true) + 2;
var_dump(time_sleep_until( (int)$time ));
$sleepUntil = (int) $time;
var_dump(time_sleep_until($sleepUntil));
$now = microtime(true);
if (substr(PHP_OS, 0, 3) == 'WIN') {
// on windows, time_sleep_until has millisecond accuracy while microtime() is accurate
@ -27,8 +28,16 @@ Michele Orselli mo@ideato.it
$tmp = round($now, 3);
$now = $tmp >= (int)$time ? $tmp : $tmp + .05;
}
var_dump($now >= (int)$time);
if ($now >= $sleepUntil) {
echo "Success\n";
} else {
echo "Sleep until (before truncation): ", $time, "\n";
echo "Sleep until: ", $sleepUntil, "\n";
echo "Now: ", $now, "\n";
}
?>
--EXPECT--
bool(true)
bool(true)
Success