Bug #81107 [Opn]: Regression in 8.1: sorting dates differ from > operator

From: Date: Fri, 04 Jun 2021 22:53:26 +0000
Subject: Bug #81107 [Opn]: Regression in 8.1: sorting dates differ from > operator
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-234217@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81107&edit=1

 ID:                 81107
 User updated by:    kylekatarnls at gmail dot com
 Reported by:        kylekatarnls at gmail dot com
 Summary:            Regression in 8.1: sorting dates differ from >
                     operator
 Status:             Open
 Type:               Bug
 Package:            Date/time related
 Operating System:   Ubuntu
 PHP Version:        master-Git-2021-06-04 (Git)
 Block user comment: N
 Private report:     N

 New Comment:

Maximum year before it start failing is 1732385841753851055


Previous Comments:
------------------------------------------------------------------------
[2021-06-04 22:45:22] 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


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=81107&edit=1


Thread (3 messages)

« previous php.bugs (#234217) next »