3v4l.org

run code in 200+ PHP versions simultaneously
<?php $start = new DateTimeImmutable('2012-07-01'); $interval = new DateInterval('P7D'); $periodWithRecurrences = new DatePeriod($start, $interval, 0);
Output for 7.2.19 - 7.2.22, 7.3.6 - 7.4.6
Fatal error: Uncaught Exception: DatePeriod::__construct(): The recurrence count '0' is invalid. Needs to be > 0 in /in/vjVTF:6 Stack trace: #0 /in/vjVTF(6): DatePeriod->__construct(Object(DateTimeImmutable), Object(DateInterval), 0) #1 {main} thrown in /in/vjVTF on line 6
Process exited with code 255.
Output for 5.5.0 - 7.2.18, 7.3.0 - 7.3.5
Output for 5.0.0 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/vjVTF on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetimeimmutable in /in/vjVTF on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetimeimmutable in /in/vjVTF on line 3