Edit report at https://bugs.php.net/bug.php?id=54567&edit=1
ID: 54567 Updated by: ni...@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