3v4l.org

run code in 300+ PHP versions simultaneously
<?php $d1=new DateTimeImmutable('03/08/2015 1:59am GMT-05:00'); echo $d1->format(DateTime::ISO8601)."\n"; $d2 = $d1->modify('+1 hours'); echo $d1->format(DateTime::ISO8601)."\n"; echo "--\n"; $d1=new DateTimeImmutable('03/08/2015 1:59am GMT-05:00'); echo $d1->format(DateTime::ISO8601)."\n"; $d2 = clone $d1; echo $d2->format(DateTime::ISO8601)."\n";
Output for 5.5.24 - 5.5.35, 5.6.7 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.10, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
2015-03-08T01:59:00-0500 2015-03-08T01:59:00-0500 -- 2015-03-08T01:59:00-0500 2015-03-08T01:59:00-0500
Output for 5.4.2 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/QKTeY on line 3
Process exited with code 255.

preferences:
161.58 ms | 401 KiB | 221 Q