PHP :: Bug #45682 :: Unable to var_dump(DateInterval)
| Bug #45682 | Unable to var_dump(DateInterval) | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2008-08-01 19:15 UTC | Modified: | 2009-05-03 18:46 UTC |
|
||||||||||
| 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 | |||||||||||
[2008-08-01 19:15 UTC] hannes dot magnusson at gmail dot com
Description:
------------
The DateInterval does not seem to expose its properties to var_dump()..
Reproduce code:
---------------
bjori@lohan:~$ cat test.php
<?php
$date = new DateTime("28-July-2008");
$other = new DateTime("31-July-2008");
$diff = date_diff($date, $other);
var_dump($diff);
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.
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2009-05-03 18:46 UTC] derick@php.net