bug68406.phpt 593 B

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