|  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
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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
29 - 7 = ?
Subscribe to this entry?

 [2013-09-20 14:28 UTC] sebastiankuhlmann at web dot de
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. might be related to this.

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


Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


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
 [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: Sun Apr 21 22:01:31 2024 UTC