Edit report at https://bugs.php.net/bug.php?id=42351&edit=1
ID: 42351
Updated by: derick@php.net
Reported by: mattsch at gmail dot com
Summary: Unable to create dates with years <= -10000 and >=
10000
-Status: Open
+Status: Closed
Type: Feature/Change Request
Package: Date/time related
Operating System: Gentoo Linux 13.0
PHP Version: 5.6.4
-Assigned To:
+Assigned To: derick
Block user comment: N
Private report: N
New Comment:
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at
http://www.php.net/downloads.php
This fix will be in PHP 8, as it forms part of the master branch of timelib.
Previous Comments:
------------------------------------------------------------------------
[2019-02-20 21:36:12] icyd3mon at gmail dot com
This still persists in PHP 7.2.9.
I think the perpetrator lies in https://github.com/php/php-src/blob/653e47da1690ee91fb62488944d43cf70cbbd0a8/ext/date/lib/parse_date.c#L25252
Where it is assumed that the maximum length of year is four digits.
Effectively, it could be 8 digits, since
<?php
$date = new \DateTime('@'.PHP_INT_MAX);
echo $date->format('c');
?>
returns "219250468-12-04T15:30:07+00:00"
------------------------------------------------------------------------
[2014-12-30 15:13:15] mattsch at gmail dot com
fixed summary
------------------------------------------------------------------------
[2014-12-30 15:12:30] mattsch at gmail dot com
I wasn't able to change the status to re-opened. Please reopen.
------------------------------------------------------------------------
[2014-12-30 15:11:25] mattsch at gmail dot com
What are you talking about? I've given you all the information you need to reproduce the bug
and the reason why it's a bug. Why are you closing this case? Note that I just retested with
the latest version of php and it is still not fixed yet.
------------------------------------------------------------------------
[2014-12-30 10:41:28] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=42351
--
Edit this bug report at https://bugs.php.net/bug.php?id=42351&edit=1