xref: /PHP-7.2/ext/date/tests/015.phpt (revision a9e5e222)
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--EXPECTF--
17string(3) "UTC"
18string(3) "UTC"
19string(10) "US/Eastern"
20string(3) "UTC"
21Done
22