3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dt = new DateTime(); echo $dt->format('Y-m-d H:i:s') . ", "; $dt = $dt->add(new \DateInterval("P1i")); echo $dt->format('Y-m-d H:i:s') . ", ";
based on nAuVp
Output for 7.0.0, 7.0.2 - 7.3.0alpha1
2017-02-09 09:58:52, Fatal error: Uncaught Exception: DateInterval::__construct(): Unknown or bad format (P1i) in /in/fUDCv:6 Stack trace: #0 /in/fUDCv(6): DateInterval->__construct('P1i') #1 {main} thrown in /in/fUDCv on line 6
Process exited with code 255.
Output for 7.0.1
2017-02-09 09:58:53, Fatal error: Uncaught Exception: DateInterval::__construct(): Unknown or bad format (P1i) in /in/fUDCv:6 Stack trace: #0 /in/fUDCv(6): DateInterval->__construct('P1i') #1 {main} thrown in /in/fUDCv on line 6
Process exited with code 255.
Output for hhvm-3.12.14 - 3.17.3
2017-02-09 09:58:52, Fatal error: Uncaught exception 'Exception' with message 'DateInterval::__construct: Invalid interval (P1i)' in /in/fUDCv:6 Stack trace: #0 /in/fUDCv(6): DateInterval->__construct() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
2017-02-09 09:58:52, Fatal error: Uncaught exception 'Exception' with message 'DateInterval::__construct(): Unknown or bad format (P1i)' in /in/fUDCv:6 Stack trace: #0 /in/fUDCv(6): DateInterval->__construct('P1i') #1 {main} thrown in /in/fUDCv on line 6
Process exited with code 255.