1--TEST-- 2Test serialization of DateTimeZone objects 3--FILE-- 4<?php 5//Set the default time zone 6date_default_timezone_set("Europe/London"); 7 8$tz1 = new DateTimeZone("America/New_York"); 9var_dump( $tz1 ); 10$serialized = serialize($tz1); 11var_dump($serialized); 12 13$tz2 = unserialize($serialized); 14var_dump($tz2); 15// Try to use unserialzied object 16var_dump( $tz2->getName() ); 17 18?> 19===DONE=== 20--EXPECTF-- 21object(DateTimeZone)#%d (0) { 22} 23string(24) "O:12:"DateTimeZone":0:{}" 24object(DateTimeZone)#%d (0) { 25} 26 27Warning: DateTimeZone::getName(): The DateTimeZone object has not been correctly initialized by its constructor in %s on line %d 28bool(false) 29===DONE===