Bug #75354 [Com]: Decimal places of DateInterval::$f are lost

From: Date: Thu, 12 Oct 2017 11:53:08 +0000
Subject: Bug #75354 [Com]: Decimal places of DateInterval::$f are lost
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-211641@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75354&edit=1

 ID:                 75354
 Comment by:         thiago dot oak at gmail dot com
 Reported by:        christian dot flothmann at sensiolabs dot de
 Summary:            Decimal places of DateInterval::$f are lost
 Status:             Open
 Type:               Bug
 Package:            Date/time related
 PHP Version:        7.2.0RC3
 Block user comment: N
 Private report:     N

 New Comment:

This seems to be fixed on the latest master


Previous Comments:
------------------------------------------------------------------------
[2017-10-10 16:33:02] christian dot flothmann at sensiolabs dot de

Description:
------------
Since PHP 7.2 RC1 microseconds are returned as 0 (see https://3v4l.org/W3Xld).

Test script:
---------------
$i = new \DateInterval('PT0S');
$i->f = 0.1;

var_dump($i->f);

Expected result:
----------------
float(0.1)

Actual result:
--------------
float(0)


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=75354&edit=1


Thread (3 messages)

« previous php.bugs (#211641) next »