3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $d1=new DateTimeImmutable('03/08/2015 1:59am GMT-05:00'); echo $d1->format(DateTime::ISO8601)."\n"; //$d2 = $d1->modify('+0 hours'); echo $d2->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";
based on hS2vu
Output for 7.0.5 - 7.2.0
2015-03-08T01:59:00-0500 Notice: Undefined variable: d2 in /in/O980R on line 7 Fatal error: Uncaught Error: Call to a member function format() on null in /in/O980R:7 Stack trace: #0 {main} thrown in /in/O980R on line 7
Process exited with code 255.
Output for 7.0.0 - 7.0.4
2015-03-08T01:59:00-0500 Notice: Undefined variable: d2 in /in/O980R on line 7 Fatal error: Uncaught Error: Call to a member function format() on unknown in /in/O980R:7 Stack trace: #0 {main} thrown in /in/O980R on line 7
Process exited with code 255.
Output for 5.6.7 - 5.6.28
2015-03-08T01:59:00-0500 Notice: Undefined variable: d2 in /in/O980R on line 7 Fatal error: Call to a member function format() on null in /in/O980R on line 7
Process exited with code 255.
Output for 5.5.24 - 5.5.35
2015-03-08T01:59:00-0500 Notice: Undefined variable: d2 in /in/O980R on line 7 Fatal error: Call to a member function format() on a non-object in /in/O980R on line 7
Process exited with code 255.
Output for 5.3.17 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/O980R on line 3
Process exited with code 255.