3v4l.org

run code in 300+ PHP versions simultaneously
<?php $i=DateInterval::createFromDateString('P1D');//expected to fail $d1=date_create('1000-10-27'); $d2=date_create('2009-11-15'); $p=new DatePeriod($d1,$i,$d2); //PHP times out
Output for 8.3.0 - 8.3.6
Fatal error: Uncaught DateMalformedIntervalStringException: Unknown or bad format (P1D) at position 1 (1): Unexpected character in /in/XaOG4:3 Stack trace: #0 /in/XaOG4(3): DateInterval::createFromDateString('P1D') #1 {main} thrown in /in/XaOG4 on line 3
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
Warning: DateInterval::createFromDateString(): Unknown or bad format (P1D) at position 1 (1): Unexpected character in /in/XaOG4 on line 3 Fatal error: Uncaught TypeError: DatePeriod::__construct() accepts (DateTimeInterface, DateInterval, int [, int]), or (DateTimeInterface, DateInterval, DateTime [, int]), or (string [, int]) as arguments in /in/XaOG4:6 Stack trace: #0 /in/XaOG4(6): DatePeriod->__construct(Object(DateTime), false, Object(DateTime)) #1 {main} thrown in /in/XaOG4 on line 6
Process exited with code 255.
Output for 7.2.17 - 7.2.33, 7.3.4 - 7.3.33, 7.4.0 - 7.4.33
Warning: DateInterval::createFromDateString(): Unknown or bad format (P1D) at position 1 (1): Unexpected character in /in/XaOG4 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/XaOG4:6 Stack trace: #0 /in/XaOG4(6): DatePeriod->__construct(Object(DateTime), false, Object(DateTime)) #1 {main} thrown in /in/XaOG4 on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.16, 7.3.0 - 7.3.3
Output for 5.0.0 - 5.0.5, 5.1.1 - 5.1.6, 5.2.0 - 5.2.17
Fatal error: Class 'DateInterval' not found in /in/XaOG4 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/XaOG4 on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Fatal error: Undefined class name 'dateinterval' in /in/XaOG4 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Undefined class name 'dateinterval' in /in/XaOG4 on line 3

preferences:
284.82 ms | 401 KiB | 456 Q