#45682 [Asn->Csd]: Unable to var_dump(DateInterval)

From: Date: Sun, 03 May 2009 18:46:35 +0000
Subject: #45682 [Asn->Csd]: Unable to var_dump(DateInterval)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-136685@lists.php.net to get a copy of this message
ID: 45682 Updated by: derick@php.net Reported By: hannes dot magnusson at gmail dot com -Status: Assigned +Status: Closed Bug Type: Date/time related Operating System: * PHP Version: 5.3CVS-2008-11-11 Assigned To: derick New Comment: 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 http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2008-08-01 19:15:35] 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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45682&edit=1

« previous php.bugs (#136685) next »