3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dateTime = new DateTime(); $interval = new DateInterval('1Y2M3D'); // $dateTime->add($interval); // echo $dateTime->format(DateTime::COOKIE);
based on tiAcB
Output for 7.0.0 - 7.3.0alpha1
Fatal error: Uncaught Exception: DateInterval::__construct(): Unknown or bad format (1Y2M3D) in /in/1t565:4 Stack trace: #0 /in/1t565(4): DateInterval->__construct('1Y2M3D') #1 {main} thrown in /in/1t565 on line 4
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught exception 'Exception' with message 'DateInterval::__construct: Invalid interval (1Y2M3D)' in /in/1t565:-1 Stack trace: #0 /in/1t565(-1): DateInterval->__construct() #1 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Fatal error: Uncaught exception 'Exception' with message 'DateInterval::__construct: Invalid interval (1Y2M3D)' in /in/1t565:4 Stack trace: #0 /in/1t565(4): DateInterval->__construct() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Uncaught exception 'Exception' with message 'DateInterval::__construct(): Unknown or bad format (1Y2M3D)' in /in/1t565:4 Stack trace: #0 /in/1t565(4): DateInterval->__construct('1Y2M3D') #1 {main} thrown in /in/1t565 on line 4
Process exited with code 255.