3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php if (class_exists('DateTimeImmutable')) { $d = new DateTimeImmutable('2012-02-01 00:00:00.123456'); $d = $d->setTimeZone(new DateTimeZone('UTC')); echo $d->format('u'), PHP_EOL; } if (class_exists('DateTimeZone')) { $d = new DateTime('2012-02-01 00:00:00.123456'); $d->setTimeZone(new DateTimeZone('UTC')); echo $d->format('u'), PHP_EOL; }
based on lqIGW
Output for 5.5.0 - 5.6.30, hhvm-3.10.1 - 3.17.3, 7.0.0 - 7.2.0
123456 123456
Output for 5.2.2 - 5.4.45
123456
Output for 5.2.0 - 5.2.1
u
Output for 4.3.0 - 5.1.6