|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45682 Unable to var_dump(DateInterval)
Submitted: 2008-08-01 19:15 UTC Modified: 2009-05-03 18:46 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: hannes dot magnusson at gmail dot com Assigned: derick (profile)
Status: Closed Package: Date/time related
PHP Version: 5.3CVS-2008-11-11 OS: *
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: hannes dot magnusson at gmail dot com
New email:
PHP Version: OS:


 [2008-08-01 19:15 UTC] hannes dot magnusson at gmail dot com
The DateInterval does not seem to expose its properties to var_dump().. 

Reproduce code:
bjori@lohan:~$ cat test.php 

$date = new DateTime("28-July-2008");
$other = new DateTime("31-July-2008");

$diff = date_diff($date, $other);

echo $diff, "\n";

bjori@lohan:~$ ~/php/5.3/sapi/cli/php test.php 
object(DateInterval)#3 (0) {

Catchable fatal error: Object of class DateInterval could not be converted to string in /crypto/bjori/test.php on line 9

Expected result:
The properties to retrieve the actual difference.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-03 18:46 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Nov 26 08:05:54 2022 UTC