3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $flightTime = new DateTimeImmutable(); $expirationTime = $flightTime->add(new \DateInterval('PT1h')); echo $expirationTime->format('Y-m-d h:i');
based on 2sXrc
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Exception: DateInterval::__construct(): Unknown or bad format (PT1h) in /in/6nrJ0:4 Stack trace: #0 /in/6nrJ0(4): DateInterval->__construct('PT1h') #1 {main} thrown in /in/6nrJ0 on line 4
Process exited with code 255.
Output for 5.5.24 - 5.6.28
Fatal error: Uncaught exception 'Exception' with message 'DateInterval::__construct(): Unknown or bad format (PT1h)' in /in/6nrJ0:4 Stack trace: #0 /in/6nrJ0(4): DateInterval->__construct('PT1h') #1 {main} thrown in /in/6nrJ0 on line 4
Process exited with code 255.
Output for 5.3.21 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/6nrJ0 on line 3
Process exited with code 255.