From: Operating system: - PHP version: 5.3.6 Package: Date/time related Bug Type: Feature/Change Request Bug description:DateTimeZone does not serialize
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 bug report at http://bugs.php.net/bug.php?id=54567&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54567&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54567&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54567&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=54567&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54567&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=54567&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=54567&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=54567&r=needscript Try newer version: http://bugs.php.net/fix.php?id=54567&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=54567&r=support Expected behavior: http://bugs.php.net/fix.php?id=54567&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=54567&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=54567&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=54567&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54567&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=54567&r=dst IIS Stability: http://bugs.php.net/fix.php?id=54567&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=54567&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=54567&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=54567&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=54567&r=mysqlcfg
