Bug #77145 [NEW]: Inconsistent handle of negative interval lower than 1 second

From: Date: Tue, 13 Nov 2018 12:46:20 +0000
Subject: Bug #77145 [NEW]: Inconsistent handle of negative interval lower than 1 second
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217925@lists.php.net to get a copy of this message
From: kylekatarnls at gmail dot com Operating system: PHP version: 7.3.0RC5 Package: Date/time related Bug Type: Bug Bug description:Inconsistent handle of negative interval lower than 1 second Description: ------------ When calling DateTime::diff from (DateX) to (DateX - few microseconds), I get inconsistent intervals between versions and none are what I would expect (inverted interval with positive microseconds). Test script: --------------- $s = new DateTime('2018-10-11 20:59:06.914653'); $e = new DateTime('2018-10-11 20:59:06.237419'); echo $s->diff($e)->format('%R %Y-%M-%D %H:%I:%S.%F'); Expected result: ---------------- - 00-00-00 00:00:00.677234 Actual result: -------------- Output for 7.3.0rc4 - 7.3.0rc5 + -1-11-29 23:59:59.322766 Output for 7.1.0 - 7.3.0rc3 + 00-00-00 00:00:00.-677234 As tested with https://3v4l.org/hnnL0 Note sure, but I guess 7.2.12 would looks like 7.3.0rc5 as it's probably consecutive to https://bugs.php.net/bug.php?id=77007 bugfix -- Edit bug report at https://bugs.php.net/bug.php?id=77145&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77145&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77145&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77145&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=77145&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=77145&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=77145&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=77145&r=needscript Try newer version: https://bugs.php.net/fix.php?id=77145&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=77145&r=support Expected behavior: https://bugs.php.net/fix.php?id=77145&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=77145&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=77145&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=77145&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77145&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=77145&r=dst IIS Stability: https://bugs.php.net/fix.php?id=77145&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=77145&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=77145&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=77145&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=77145&r=mysqlcfg

« previous php.bugs (#217925) next »