3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump((new DateTime)->add(new DateInterval('1 year'))->format('Y-m-d'));
based on eCrAr
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Exception: DateInterval::__construct(): Unknown or bad format (1 year) in /in/Tlsie:3 Stack trace: #0 /in/Tlsie(3): DateInterval->__construct('1 year') #1 {main} thrown in /in/Tlsie on line 3
Process exited with code 255.
Output for 5.4.10 - 5.6.28
Fatal error: Uncaught exception 'Exception' with message 'DateInterval::__construct(): Unknown or bad format (1 year)' in /in/Tlsie:3 Stack trace: #0 /in/Tlsie(3): DateInterval->__construct('1 year') #1 {main} thrown in /in/Tlsie on line 3
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/Tlsie on line 3
Process exited with code 255.