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

From: Date: Fri, 01 Aug 2008 22:08:00 +0000
Subject: #45682 [Opn->Asn]: Unable to var_dump(DateInterval)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-127480@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: Open +Status: Assigned Bug Type: Date/time related Operating System: Linux PHP Version: 5.3.0alpha1 -Assigned To: +Assigned To: derick 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 (#127480) next »