summaryrefslogtreecommitdiff
path: root/ext/date/tests/bug73837.phpt
blob: 7319a1327f430cd351df0ccc51a265a8b4e8f673 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--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