mirror of
https://github.com/php/php-src.git
synced 2024-11-25 19:05:31 +08:00
22 lines
446 B
PHP
22 lines
446 B
PHP
--TEST--
|
|
timezone object reference handling
|
|
--FILE--
|
|
<?php
|
|
date_default_timezone_set('UTC');
|
|
$dto = new DateTime();
|
|
$tzold = $dto->getTimezone();
|
|
var_dump($tzold->getName());
|
|
$dto->setTimezone(new DateTimeZone('US/Eastern'));
|
|
var_dump($tzold->getName());
|
|
var_dump($dto->getTimezone()->getName());
|
|
unset($dto);
|
|
var_dump($tzold->getName());
|
|
echo "Done\n";
|
|
?>
|
|
--EXPECTF--
|
|
string(3) "UTC"
|
|
string(3) "UTC"
|
|
string(10) "US/Eastern"
|
|
string(3) "UTC"
|
|
Done
|