|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-06-04 18:22 UTC] kylekatarnls at gmail dot com
[2021-06-04 19:08 UTC] kylekatarnls at gmail dot com
[2021-06-09 18:31 UTC] patrickallaert@php.net
-Assigned To:
+Assigned To: derick
[2021-06-09 18:32 UTC] patrickallaert@php.net
[2021-08-08 16:28 UTC] derick@php.net
-Status: Assigned
+Status: Closed
[2021-08-08 16:28 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 18:00:02 2025 UTC |
Description: ------------ An interval with ->f = 1.234 was previously understood as 1.234 second when using in DateTime::add() which sounds pretty consistent. Now it's understood as 0.234 which feels pretty unsafe. Moreover, if we dump the interval, we see ->f value is still 1.234. If ->f can now longer be >= 1, it would rather need to throw an exception rather than accepting it and be interpreted differently regarding where it's used. Test script: --------------- $dateInterval = new DateInterval('PT0S'); $dateInterval->f = 1.234; echo (new DateTimeImmutable('2000-01-01 00:00:00'))->add($dateInterval)->format('Y-m-d H:i:s.u'); Expected result: ---------------- 2000-01-01 00:00:01.234000 (What we got for PHP <= 8.0) Actual result: -------------- 2000-01-01 00:00:00.234000 (What we get now with master branch)