3v4l.org

run code in 500+ PHP versions simultaneously
<?php $interval = new \DateInterval('P0M0DT-4H0M0S'); var_dump($interval);
Output for 8.1.0 - 8.1.34, 8.2.0 - 8.2.34
Fatal error: Uncaught Exception: Unknown or bad format (P0M0DT-4H0M0S) in /in/olhe7:3 Stack trace: #0 /in/olhe7(3): DateInterval->__construct('P0M0DT-4H0M0S') #1 {main} thrown in /in/olhe7 on line 3
Process exited with code 255.
Output for 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
Fatal error: Uncaught Exception: DateInterval::__construct(): Unknown or bad format (P0M0DT-4H0M0S) in /in/olhe7:3 Stack trace: #0 /in/olhe7(3): DateInterval->__construct('P0M0DT-4H0M0S') #1 {main} thrown in /in/olhe7 on line 3
Process exited with code 255.
Output for 8.3.0 - 8.3.35, 8.4.1 - 8.4.26, 8.5.0 - 8.5.11
Fatal error: Uncaught DateMalformedIntervalStringException: Unknown or bad format (P0M0DT-4H0M0S) in /in/olhe7:3 Stack trace: #0 /in/olhe7(3): DateInterval->__construct('P0M0DT-4H0M0S') #1 {main} thrown in /in/olhe7 on line 3
Process exited with code 255.

preferences:
29.17 ms | 1144 KiB | 11 Q