]> granicus.if.org Git - php/commitdiff
Bug #66836 has been fixed
authorChristoph M. Becker <cmb@php.net>
Mon, 11 Jul 2016 14:06:35 +0000 (16:06 +0200)
committerChristoph M. Becker <cmb@php.net>
Mon, 11 Jul 2016 14:06:35 +0000 (16:06 +0200)
NEWS
ext/date/tests/bug66836.phpt [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index 282f20d725a1295584ce92ac0719c9616c923c53..2b21a03c0ee17ab64d99f83e65fc16d469b86221 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,10 @@ PHP                                                                        NEWS
   . Fixed bug #71144 (Segmentation fault when using cURL with ZTS).
     (maroszek at gmx dot net)
 
+- Date:
+  . Fixed bug #66836 (DateTime::createFromFormat 'U' with pre 1970 dates fails
+    parsing). (derick)
+
 - Filter:
   . Fixed bug #71745 (FILTER_FLAG_NO_RES_RANGE does not cover whole 127.0.0.0/8
     range). (bugs dot php dot net at majkl578 dot cz)
diff --git a/ext/date/tests/bug66836.phpt b/ext/date/tests/bug66836.phpt
new file mode 100644 (file)
index 0000000..8fab783
--- /dev/null
@@ -0,0 +1,15 @@
+--TEST--
+Bug #66836 (DateTime::createFromFormat 'U' with pre 1970 dates fails parsing)
+--INI--
+date.timezone=Europe/Berlin
+--FILE--
+<?php
+foreach (['-1', '-86400', '-1000000'] as $timestamp) {
+    $dt = DateTime::createFromFormat('U', $timestamp);
+    var_dump($dt->format('U') === $timestamp);
+}
+?>
+--EXPECT--
+bool(true)
+bool(true)
+bool(true)