3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $period = new DatePeriod( new DateTimeImmutable, new DateInterval('P1D'), new DateTimeImmutable );
Output for 5.5.8 - 7.1.0
Output for 5.5.0 - 5.5.7
Fatal error: Uncaught exception 'Exception' with message 'DatePeriod::__construct(): This constructor accepts either (DateTimeInterface, DateInterval, int) OR (DateTimeInterface, DateInterval, DateTime) OR (string) as arguments.' in /in/834gr:6 Stack trace: #0 /in/834gr(6): DatePeriod->__construct(Object(DateTimeImmutable), Object(DateInterval), Object(DateTimeImmutable)) #1 {main} thrown in /in/834gr on line 6
Process exited with code 255.
Output for 5.3.0 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/834gr on line 3
Process exited with code 255.
Output for 5.0.0 - 5.2.17
Fatal error: Class 'DatePeriod' not found in /in/834gr on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: dateperiod in /in/834gr on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: dateperiod in /in/834gr on line 2