|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-07-06 13:37 UTC] sukei13 at gmail dot com
[2018-07-13 22:10 UTC] cmb@php.net
-Package: *General Issues
+Package: Date/time related
[2020-06-14 22:26 UTC] cmb@php.net
-Status: Open
+Status: Verified
-Type: Bug
+Type: Documentation Problem
[2020-06-14 22:26 UTC] cmb@php.net
[2021-04-07 16:40 UTC] cmb@php.net
[2022-06-04 15:43 UTC] derick@php.net
-Status: Verified
+Status: Closed
-Assigned To:
+Assigned To: derick
[2022-06-04 15:43 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 13:00:01 2025 UTC |
Description: ------------ The result of a comparison (soft: ==) between two date intervals change when the variable has been exported (var_export) earlier. The var_export function affect the internal state of the DateInterval object in some way. The following test script show this weird behavior. Note that this test has been made on other objects too (such as DateTime or DateTimeImmutable) but DateInterval seems to be the only object involved in this issue. Test script: --------------- <?php $a = new DateInterval('P2Y4DT6H8M'); $b = new DateInterval('P2Y4DT6H8M'); var_dump($a == $b); // true var_export($b, true); var_dump($a == $b); // false Expected result: ---------------- bool(true) bool(true) Actual result: -------------- bool(true) bool(false)