xref: /PHP-8.4/ext/date/tests/015.phpt (revision ded3d984)
1--TEST--
2timezone object reference handling
3--FILE--
4<?php
5date_default_timezone_set('UTC');
6$dto = new DateTime();
7$tzold = $dto->getTimezone();
8var_dump($tzold->getName());
9$dto->setTimezone(new DateTimeZone('US/Eastern'));
10var_dump($tzold->getName());
11var_dump($dto->getTimezone()->getName());
12unset($dto);
13var_dump($tzold->getName());
14echo "Done\n";
15?>
16--EXPECT--
17string(3) "UTC"
18string(3) "UTC"
19string(10) "US/Eastern"
20string(3) "UTC"
21Done
22