|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-11-08 09:55 UTC] cmb@php.net
-Status: Open
+Status: Duplicate
-Assigned To:
+Assigned To: cmb
[2018-11-08 09:55 UTC] cmb@php.net
[2018-11-08 11:24 UTC] sakari dot laine at verkkokauppa dot com
-PHP Version: 7.2.12RC1
+PHP Version: 7.2.12
[2018-11-08 11:24 UTC] sakari dot laine at verkkokauppa dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 17:00:02 2025 UTC |
Description: ------------ Datetime diff overflows if fractions and no fractions in same second. Test script: --------------- $date = new \DateTime('2018-11-08 10:22:43'); $date2 = new \DateTime('2018-11-08 10:22:43.123456'); print_r($date2->diff($date)); Expected result: ---------------- DateInterval Object ( [y] => 0 [m] => 0 [d] => 0 [h] => 0 [i] => 0 [s] => 0 [f] => -0.123456 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 0 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 ) Actual result: -------------- DateInterval Object ( [y] => -1 [m] => 11 [d] => 30 [h] => 23 [i] => 59 [s] => 59 [f] => 0.876544 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 0 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )