3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $d = new DateTimeImmutable('2015-11-16'); $d2 = $d->setDate(1980, 10, 29); print $d2->format('c') . PHP_EOL; $d3 = $d1->modify('+1 day'); print $d3->format('c') . PHP_EOL; print $d->format('c') . PHP_EOL;
based on 5gHRX
Output for 7.0.5 - 7.2.0
1980-10-29T00:00:00+01:00 Notice: Undefined variable: d1 in /in/r5BM7 on line 8 Fatal error: Uncaught Error: Call to a member function modify() on null in /in/r5BM7:8 Stack trace: #0 {main} thrown in /in/r5BM7 on line 8
Process exited with code 255.
Output for 7.0.0 - 7.0.4
1980-10-29T00:00:00+01:00 Notice: Undefined variable: d1 in /in/r5BM7 on line 8 Fatal error: Uncaught Error: Call to a member function modify() on unknown in /in/r5BM7:8 Stack trace: #0 {main} thrown in /in/r5BM7 on line 8
Process exited with code 255.
Output for 5.6.8 - 5.6.28
1980-10-29T00:00:00+01:00 Notice: Undefined variable: d1 in /in/r5BM7 on line 8 Fatal error: Call to a member function modify() on null in /in/r5BM7 on line 8
Process exited with code 255.
Output for 5.5.24 - 5.5.35
1980-10-29T00:00:00+01:00 Notice: Undefined variable: d1 in /in/r5BM7 on line 8 Fatal error: Call to a member function modify() on a non-object in /in/r5BM7 on line 8
Process exited with code 255.
Output for 5.3.19 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/r5BM7 on line 3
Process exited with code 255.