xref: /PHP-8.3/ext/date/tests/bug73837.phpt (revision c854bb24)
1--TEST--
2Bug #73837: Milliseconds in DateTime()
3--SKIPIF--
4<?php
5if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
6?>
7--FILE--
8<?php
9$startTS = time();
10$prev_dt = new DateTime();
11while (time() < $startTS + 2) {
12    $dt = new DateTime();
13    if ($prev_dt > $dt) {
14        var_dump($prev_dt->format("Y-m-d H:i:s.u"));
15        var_dump($dt->format("Y-m-d H:i:s.u"));
16        break;
17    }
18    $prev_dt = $dt;
19}
20
21echo "Finished\n";
22?>
23--EXPECTF--
24Finished
25