Bug #77145 [Opn->Dup]: Inconsistent handle of negative interval lower than 1 second

From: Date: Tue, 13 Nov 2018 13:42:17 +0000
Subject: Bug #77145 [Opn->Dup]: Inconsistent handle of negative interval lower than 1 second
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217928@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77145&edit=1 ID: 77145 Updated by: cmb@php.net Reported by: kylekatarnls at gmail dot com Summary: Inconsistent handle of negative interval lower than 1 second -Status: Open +Status: Duplicate Type: Bug Package: Date/time related PHP Version: 7.3.0RC5 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: This looks like a duplicate of bug #77097. Previous Comments: ------------------------------------------------------------------------ [2018-11-13 12:46:20] kylekatarnls at gmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=77145&edit=1

« previous php.bugs (#217928) next »