3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $now = new DateTime(); $interval = new DateInterval('T2H3M'); $now->add($interval); echo $now->format('d-m-Y H:i');
Output for 7.0.0 - 7.2.9
Fatal error: Uncaught Exception: DateInterval::__construct(): Unknown or bad format (T2H3M) in /in/AYSKl:4 Stack trace: #0 /in/AYSKl(4): DateInterval->__construct('T2H3M') #1 {main} thrown in /in/AYSKl on line 4
Process exited with code 255.
Output for hhvm-3.18.5, hhvm-3.22.0
Fatal error: Uncaught exception 'Exception' with message 'DateInterval::__construct: Invalid interval (T2H3M)' in /in/AYSKl:-1 Stack trace: #0 /in/AYSKl(-1): DateInterval->__construct() #1 {main}
Process exited with code 255.
Output for hhvm-3.15.4 - 3.18.4, hhvm-3.19.2 - 3.21.3
Fatal error: Uncaught exception 'Exception' with message 'DateInterval::__construct: Invalid interval (T2H3M)' in /in/AYSKl:4 Stack trace: #0 /in/AYSKl(4): DateInterval->__construct() #1 {main}
Process exited with code 255.
Output for 5.6.30
Fatal error: Uncaught exception 'Exception' with message 'DateInterval::__construct(): Unknown or bad format (T2H3M)' in /in/AYSKl:4 Stack trace: #0 /in/AYSKl(4): DateInterval->__construct('T2H3M') #1 {main} thrown in /in/AYSKl on line 4
Process exited with code 255.