3v4l.org

run code in 200+ PHP versions simultaneously
<?php $dp = new DatePeriod( new DateTime('2012-07-01T00:00:00Z'), new DateInterval('P7D'), 0 ); var_dump($dp->getRecurrences()); //expected 0
Output for 7.2.19 - 7.2.26, 7.3.6 - 7.4.6
Fatal error: Uncaught Exception: DatePeriod::__construct(): The recurrence count '0' is invalid. Needs to be > 0 in /in/E8MT8:6 Stack trace: #0 /in/E8MT8(6): DatePeriod->__construct(Object(DateTime), Object(DateInterval), 0) #1 {main} thrown in /in/E8MT8 on line 6
Process exited with code 255.
Output for 7.2.17 - 7.2.18, 7.3.4 - 7.3.5
NULL
Output for 7.1.0 - 7.2.16, 7.3.0 - 7.3.3
Fatal error: Uncaught Error: Call to undefined method DatePeriod::getRecurrences() in /in/E8MT8:9 Stack trace: #0 {main} thrown in /in/E8MT8 on line 9
Process exited with code 255.