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 = date_create("2012-01-01 10:00 +1:00")->getTimezone(); 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 (2) { 22 ["timezone_type"]=> 23 int(1) 24 ["timezone"]=> 25 string(6) "+01:00" 26} 27string(77) "O:12:"DateTimeZone":2:{s:13:"timezone_type";i:1;s:8:"timezone";s:6:"+01:00";}" 28object(DateTimeZone)#%d (2) { 29 ["timezone_type"]=> 30 int(1) 31 ["timezone"]=> 32 string(6) "+01:00" 33} 34string(6) "+01:00" 35===DONE=== 36