xref: /PHP-8.1/ext/date/tests/bug68406.phpt (revision 7aacc705)
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?>
21--EXPECT--
22object(DateTimeZone)#4 (2) {
23  ["timezone_type"]=>
24  int(3)
25  ["timezone"]=>
26  string(13) "Europe/Berlin"
27}
28object(DateTimeZone)#2 (2) {
29  ["timezone_type"]=>
30  int(3)
31  ["timezone"]=>
32  string(13) "Europe/Berlin"
33}
34yes
35