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'); } if (class_exists('DateTimeZone')) { $d = new DateTime('2012-02-01 00:00:00.123456'); $d->setTimeZone(new DateTimeZone('UTC')); echo $d->format('u'); }
based on qTcHf
Output for 5.5.24 - 7.2.0
123456123456
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