3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = (new DateTimeImmutable('today')) ->setTimeZone(new DateTimeZone('UTC')) ->setTime(10, 10, 10); $y = (new DateTimeImmutable('today')) ->setTimeZone(new DateTimeZone('Europe/Rome')) ->setTime(10, 10, 10); var_dump($x->format('U')); var_dump($y->format('U'));
based on 6ElvY
Output for 5.5.0 - 7.3.1
string(10) "1444644610" string(10) "1444723810"
Output for 5.4.0 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/He0tb on line 3
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/He0tb on line 4
Process exited with code 255.