1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 11:13:36 +02:00
Files
archived-php-src/ext/date/tests/bug73837.phpt
T
Nikita Popov 08ad9af2ca Reduce date test threshold further
Still seeing the occasional spurious failure.
2021-03-05 16:31:24 +01:00

21 lines
445 B
PHP

--TEST--
Bug #73837: Milliseconds in DateTime()
--FILE--
<?php
$collect = [];
for ( $i = 0; $i < 1000; $i++ )
{
$a = new DateTime();
$key = "s" . $a->format( "u" );
$collect[$key] = true;
}
// For low-resolution clocks, we may construct many objects in the same tick.
var_dump($n = count( $collect ));
echo $n > 400 ? "microseconds differ\n" : "microseconds do not differ enough ($n)\n";
?>
--EXPECTF--
int(%d)
microseconds differ