php.net |  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: 2021-06-09 18:35 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: kylekatarnls at gmail dot com Assigned: derick (profile)
Status: Assigned 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.
Password:
Status:
Package:
Bug Type:
Summary:
From: kylekatarnls at gmail dot com
New email:
PHP Version: OS:

 

 [2021-06-04 22:45 UTC] kylekatarnls at gmail dot com
Description:
------------
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:
---------------
var_dump(
    (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:
----------------
true

Actual result:
--------------
false

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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] patrickallaert@php.net
-Assigned To: +Assigned To: derick
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Sep 19 00:03:39 2021 UTC