php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76462 Undefined property: DateInterval::$f
Submitted: 2018-06-12 08:43 UTC Modified: 2018-06-12 13:31 UTC
From: ak at ivaris dot ch Assigned: cmb (profile)
Status: Closed Package: Date/time related
PHP Version: 7.2.6 OS:
Private report: No CVE-ID: None
 [2018-06-12 08:43 UTC] ak at ivaris dot ch
Description:
------------
The combined assignment operators do not work for DateTime::$f

Test script:
---------------
<?php

$buggy = new DateInterval('P0Y');
$buggy->f += 0.01;

$ok = new DateInterval('P0Y');
$ok->f = $ok->f + 0.01;

var_dump($buggy->f);
var_dump($ok->f);


Expected result:
----------------
/tmp/mutime.php:9:
double(0.01)
/tmp/mutime.php:10:
double(0.01)


Actual result:
--------------
PHP Notice:  Undefined property: DateInterval::$f in /tmp/mutime.php on line 4
PHP Stack trace:
PHP   1. {main}() /tmp/mutime.php:0
/tmp/mutime.php:9:
double(0)
/tmp/mutime.php:10:
double(0.01)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-06-12 11:01 UTC] cmb@php.net
-Status: Open +Status: Verified
 [2018-06-12 11:01 UTC] cmb@php.net
Seems to be regression introduced in PHP 7.1.11, see
<https://3v4l.org/q2n1G>.
 [2018-06-12 13:31 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2018-06-12 13:33 UTC] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=72128294352e8b8dbbfe43f85cb5bf79a24a9332
Log: Fixed bug #76462 Undefined property: DateInterval::$f
 [2018-06-12 13:33 UTC] ab@php.net
-Status: Verified +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 16:01:29 2024 UTC