|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
9 + 46 = ?
Subscribe to this entry?

 [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: Sat Jun 25 23:03:49 2022 UTC