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 = clone $x; $y = $y ->setTimeZone(new DateTimeZone('Europe/Rome')) ->setTime(12, 10, 10); var_dump($x->format('U')); var_dump($y->format('U')); var_dump($x == $y);
based on 5fXUt
Output for 5.5.4 - 7.3.1
string(10) "1444644610" string(10) "1444644610" bool(true)
Output for 5.5.0 - 5.5.3
string(10) "1444644610" string(10) "1444644610" bool(false)
Output for 5.4.0 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/AZRKB 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/AZRKB on line 4
Process exited with code 255.