]> granicus.if.org Git - php/commitdiff
Added a test case to make sure microseconds work.
authorDerick Rethans <github@derickrethans.nl>
Fri, 24 Mar 2017 11:39:32 +0000 (11:39 +0000)
committerDerick Rethans <github@derickrethans.nl>
Fri, 24 Mar 2017 11:39:32 +0000 (11:39 +0000)
ext/date/tests/bug73837.phpt [new file with mode: 0644]

diff --git a/ext/date/tests/bug73837.phpt b/ext/date/tests/bug73837.phpt
new file mode 100644 (file)
index 0000000..220deb6
--- /dev/null
@@ -0,0 +1,17 @@
+--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;
+}
+
+echo ( count( $collect ) > 990 ) ? "microseconds differ\n" : "microseconds do not differ enough\n";
+?>
+--EXPECT--
+microseconds differ