3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $tz = new \DateTimeZone('Europe/Moscow'); $dt = new \DateTimeImmutable('now'); $dt = $dt->setTimezone($tz); $timestamp = (int) $dt->format('U'); $timestamp += 1000; $dt2 = \DateTimeImmutable::createFromFormat('U', (string) $timestamp, $tz); assert($dt->getTimezone() === $dt2->getTimezone());
based on f2gFN
Output for 7.0.0 - 7.2.0
Warning: assert(): assert($dt->getTimezone() === $dt2->getTimezone()) failed in /in/JXLKb on line 11
Output for 5.5.24 - 5.6.28
Warning: assert(): Assertion failed in /in/JXLKb on line 11
Output for 5.3.19 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/JXLKb on line 5
Process exited with code 255.