summaryrefslogtreecommitdiff
path: root/ext/date/tests/bug63435.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/date/tests/bug63435.phpt')
-rw-r--r--ext/date/tests/bug63435.phpt16
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/date/tests/bug63435.phpt b/ext/date/tests/bug63435.phpt
new file mode 100644
index 0000000000..dcec6e46e7
--- /dev/null
+++ b/ext/date/tests/bug63435.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #63435 Datetime::format('u') sometimes wrong by 1 microsecond
+--INI--
+date.timezone=UTC
+--FILE--
+<?php
+for ($i=1 ; $i<999 ; $i++) {
+ $datetime = Datetime::createFromFormat("u", sprintf("%06ld", $i));
+ $res = $datetime->format("u");
+ if ($res != $i) {
+ echo "$i != $res\n";
+ }
+}
+echo "Done";
+--EXPECT--
+Done