Req #54567 [Opn->Csd]: DateTimeZone does not serialize

From: Date: Fri, 26 Apr 2013 08:07:56 +0000
Subject: Req #54567 [Opn->Csd]: DateTimeZone does not serialize
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-178644@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=54567&edit=1 ID: 54567 Updated by: nikic@php.net Reported by: levi at alliancesoftware dot com dot au Summary: DateTimeZone does not serialize -Status: Open +Status: Closed Type: Feature/Change Request Package: Date/time related Operating System: - PHP Version: 5.3.6 -Assigned To: +Assigned To: nikic Block user comment: N Private report: N New Comment: Fixed, see https://github.com/php/php-src/pull/208. Previous Comments: ------------------------------------------------------------------------ [2012-09-28 13:16:59] lonnyk at gmail dot com Here is a potential PR for this bug: https://github.com/php/php-src/pull/208 ------------------------------------------------------------------------ [2011-04-19 07:30:17] levi at alliancesoftware dot com dot au Description: ------------ http://bugs.php.net/bug.php?id=41334 -- DateTime serialization was added in PHP 5.3, but DateTimeZone still serializes to an empty object, it's serialized string is always: O:12:"DateTimeZone":0:{} Test script: --------------- <? $x = new DateTimeZone('Australia/Victoria'); echo $x->getName()."\n"; $x = serialize($x); $x = unserialize($x); echo $x->getName()."\n"; ?> Expected result: ---------------- Australia/Victoria Australia/Victoria Actual result: -------------- Australia/Victoria PHP Warning: DateTimeZone::getName(): The DateTimeZone object has not been correctly initialized by its constructor in - on line 7 Warning: DateTimeZone::getName(): The DateTimeZone object has not been correctly initialized by its constructor in - on line 7 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=54567&edit=1

« previous php.bugs (#178644) next »