xref: /PHP-7.3/ext/date/tests/bug68406.phpt (revision b746e698)
1--TEST--
2Bug #68406 calling var_dump on a DateTimeZone object modifies it
3--INI--
4date.timezone=UTC
5--FILE--
6<?php
7
8$tz1 = new DateTimeZone('Europe/Berlin');
9$tz2 = new DateTimeZone('Europe/Berlin');
10
11$d = new DateTime('2014-12-24 13:00:00', $tz1);
12var_dump($d->getTimezone(), $tz2);
13
14if($tz2 == $d->getTimezone()) {
15    echo "yes";
16}
17else {
18    echo "no";
19}
20--EXPECT--
21object(DateTimeZone)#4 (2) {
22  ["timezone_type"]=>
23  int(3)
24  ["timezone"]=>
25  string(13) "Europe/Berlin"
26}
27object(DateTimeZone)#2 (2) {
28  ["timezone_type"]=>
29  int(3)
30  ["timezone"]=>
31  string(13) "Europe/Berlin"
32}
33yes
34