php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65728 \DateInterval->days turns from boolean to integer value
Submitted: 2013-09-20 14:28 UTC Modified: 2013-09-20 16:04 UTC
Votes:3
Avg. Score:3.3 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:1 (33.3%)
From: sebastiankuhlmann at web dot de Assigned:
Status: Closed Package: Date/time related
PHP Version: <5.5.4 OS: independant
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sebastiankuhlmann at web dot de
New email:
PHP Version: OS:

 

 [2013-09-20 14:28 UTC] sebastiankuhlmann at web dot de
Description:
------------
When creating a \DateInterval()-object according to the documentation the 'days'-property should be false. A var_dump on the object confirms this.
Now if you do a var_dump directly on the 'days'-property the var-type and -value changes from FALSE to -99999.
https://bugs.php.net/bug.php?id=65654 might be related to this.

Test script:
---------------
$test = new \DateInterval('P1D');

var_dump($test->days);

Expected result:
----------------
bool(false)

Actual result:
--------------
int(-99999)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-09-20 14:45 UTC] jason at fuzzystatic dot com
This seems to work as expected in PHP 5.5.4 (latest version of 5.5 at this time)
 [2013-09-20 14:48 UTC] sebastiankuhlmann at web dot de
-PHP Version: Irrelevant +PHP Version: <5.5.4
 [2013-09-20 14:48 UTC] sebastiankuhlmann at web dot de
Changed PHP Version after stumbling upon https://github.com/php/php-src/commit/b378b0b081c2c3dd4a7aa25ce4d37bad48db752e
 [2013-09-20 16:04 UTC] sebastiankuhlmann at web dot de
-Status: Open +Status: Closed
 [2013-09-20 16:04 UTC] sebastiankuhlmann at web dot de
Fixed in 5.4.20 and 5.5.4
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 18:01:29 2024 UTC