Bug #78181 [NEW]: DateInterval can no longer be comparable according to its public properties

From: Date: Wed, 19 Jun 2019 11:00:26 +0000
Subject: Bug #78181 [NEW]: DateInterval can no longer be comparable according to its public properties
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-221384@lists.php.net to get a copy of this message
From: nyamsprod at gmail dot com Operating system: No relevant PHP version: 7.4.0alpha1 Package: Date/time related Bug Type: Bug Bug description:DateInterval can no longer be comparable according to its public properties 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) -- Edit bug report at https://bugs.php.net/bug.php?id=78181&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=78181&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=78181&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=78181&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=78181&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=78181&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=78181&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=78181&r=needscript Try newer version: https://bugs.php.net/fix.php?id=78181&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=78181&r=support Expected behavior: https://bugs.php.net/fix.php?id=78181&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=78181&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=78181&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=78181&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=78181&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=78181&r=dst IIS Stability: https://bugs.php.net/fix.php?id=78181&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=78181&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=78181&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=78181&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=78181&r=mysqlcfg

« previous php.bugs (#221384) next »