3v4l.org

run code in 200+ PHP versions simultaneously
<?php $i=DateInterval::createFromDateString('P1D');//expected to fail $d1=date_create('2009-10-27'); $d2=date_create('2009-11-15'); $p=new DatePeriod($d1,$i,$d2); //PHP times out
Output for 7.3.12 - 7.4.0
Warning: DateInterval::createFromDateString(): Unknown or bad format (P1D) at position 1 (1): Unexpected character in /in/kPMor on line 3 Fatal error: Uncaught Exception: DatePeriod::__construct(): This constructor accepts either (DateTimeInterface, DateInterval, int) OR (DateTimeInterface, DateInterval, DateTime) OR (string) as arguments. in /in/kPMor:6 Stack trace: #0 /in/kPMor(6): DatePeriod->__construct(Object(DateTime), false, Object(DateTime)) #1 {main} thrown in /in/kPMor on line 6
Process exited with code 255.
Output for 5.3.0 - 7.2.11
Output for 5.0.0 - 5.0.5, 5.1.1 - 5.2.17
Fatal error: Class 'DateInterval' not found in /in/kPMor on line 3
Process exited with code 255.
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/kPMor on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Undefined class name 'dateinterval' in /in/kPMor on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Undefined class name 'dateinterval' in /in/kPMor on line 3