|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-11-13 13:42 UTC] cmb@php.net
-Status: Open
+Status: Duplicate
-Assigned To:
+Assigned To: cmb
[2018-11-13 13:42 UTC] cmb@php.net
[2018-11-13 14:15 UTC] kylekatarnls at gmail dot com
[2018-12-05 09:28 UTC] daszwarc at olx dot pl
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 12:00:01 2025 UTC |
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