|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-06-19 11:03 UTC] nikic@php.net
-Status: Open
+Status: Not a bug
[2019-06-19 11:03 UTC] nikic@php.net
[2019-06-19 11:37 UTC] nyamsprod at gmail dot com
[2019-06-19 11:41 UTC] nikic@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sat Mar 28 17:00:01 2026 UTC |
Description: ------------ The DateInterval object exposes public properties. We should be able to compare two instances based on their public properties like it is possible for any other object. It is the case currently in PHP7.3- Test script: --------------- $interval1 = new DateInterval('PT3H'); $interval2 = new DateInterval('PT3H'); var_dump($interval1 == $interval2); var_dump($interval1 === $interval2); $obj1 = new stdClass(); $obj1->foo = 'bar'; $obj2 = new stdClass(); $obj2->foo = 'bar'; var_dump($obj1 == $obj2); var_dump($obj1 === $obj2); Expected result: ---------------- bool(true) bool(false) bool(true) bool(false) Actual result: -------------- Warning: Cannot compare DateInterval objects in /in/G7jM0 on line 6 bool(false) bool(false) bool(true) bool(false)