com php-src: Added a test case to make sure microseconds work.: ext/date/tests/bug73837.phpt

[email protected] (Derick Rethans)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    ee49d4b4be730af17881dada989d9e1d9110079b
Author:    Derick Rethans <[email protected]>         Fri, 24 Mar 2017 11:39:32 +0000
Parents:   e3e35476273881c6b60ee280f58a7ce2b41b6ab6
Branches:  PHP-7.1 master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=ee49d4b4be730af17881dada989d9e1d9110079b

Log:
Added a test case to make sure microseconds work.

Changed paths:
  A  ext/date/tests/bug73837.phpt


Diff:
diff --git a/ext/date/tests/bug73837.phpt b/ext/date/tests/bug73837.phpt
new file mode 100644
index 0000000..220deb6
--- /dev/null
+++ b/ext/date/tests/bug73837.phpt
@@ -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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.