|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81107 Regression in 8.1: sorting dates differ from > operator
Submitted: 2021-06-04 22:45 UTC Modified: 2022-05-13 15:48 UTC
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: kylekatarnls at gmail dot com Assigned: derick (profile)
Status: Wont fix Package: Date/time related
PHP Version: master-Git-2021-06-04 (Git) OS: Ubuntu
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: kylekatarnls at gmail dot com
New email:
PHP Version: OS:


 [2021-06-04 22:45 UTC] kylekatarnls at gmail dot com
Previously (PHP 7.4 and 8.0) when a date with year = PHP_INT_MAX were > to a date with any lower year, it was convenient to represent an absolute maximum. And it was rather expected.

Now in 8.1 (latest on GitHub Actions), it became lower.

Test script:
    (new DateTimeImmutable('2000-12-31 23:59:59.999999'))->setDate(PHP_INT_MAX, 12, 31) >
    new DateTimeImmutable('2019-01-26 10:30:12.000000')

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-06-04 22:53 UTC] kylekatarnls at gmail dot com
Maximum year before it start failing is 1732385841753851055
 [2021-06-09 18:35 UTC]
-Assigned To: +Assigned To: derick
 [2022-05-13 15:48 UTC]
-Status: Assigned +Status: Wont fix
 [2022-05-13 15:48 UTC]
IMO this is an issue of: crap in, crap out. PHP does not support years in that range.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Jun 26 00:05:48 2022 UTC