3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date=date_create("Jun 30 2012 23:59:59", new DateTimeZone("UTC")); print_r($date); $date= $date->add(new DateInterval('P1S')); print_r($date);
based on cQ2Cj
Output for 7.0.0 - 7.2.0
DateTime Object ( [date] => 2012-06-30 23:59:59.000000 [timezone_type] => 3 [timezone] => UTC ) Fatal error: Uncaught Exception: DateInterval::__construct(): Unknown or bad format (P1S) in /in/SbHXj:4 Stack trace: #0 /in/SbHXj(4): DateInterval->__construct('P1S') #1 {main} thrown in /in/SbHXj on line 4
Process exited with code 255.
Output for 5.4.30 - 5.6.28
DateTime Object ( [date] => 2012-06-30 23:59:59.000000 [timezone_type] => 3 [timezone] => UTC ) Fatal error: Uncaught exception 'Exception' with message 'DateInterval::__construct(): Unknown or bad format (P1S)' in /in/SbHXj:4 Stack trace: #0 /in/SbHXj(4): DateInterval->__construct('P1S') #1 {main} thrown in /in/SbHXj on line 4
Process exited with code 255.
Output for 5.3.19 - 5.4.29
DateTime Object ( [date] => 2012-06-30 23:59:59 [timezone_type] => 3 [timezone] => UTC ) Fatal error: Uncaught exception 'Exception' with message 'DateInterval::__construct(): Unknown or bad format (P1S)' in /in/SbHXj:4 Stack trace: #0 /in/SbHXj(4): DateInterval->__construct('P1S') #1 {main} thrown in /in/SbHXj on line 4
Process exited with code 255.