3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $d = new \DateTime('now', new \DateTimeZone('UTC')); $d1 = new \DateTime('now'); if ($d->getTimeZone() === $d1->getTimeZone()) { echo '1'; } var_dump($d->getTimeZone(), $d1->getTimeZone());
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.0rc3
object(DateTimeZone)#4 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for hhvm-3.15.4
object(DateTimeZone)#4 (0) { } object(DateTimeZone)#5 (0) { }