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
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:
MUST BE VALID
Solve the problem:
3 + 39 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Thu Apr 18 20:01:30 2024 UTC