3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php date_default_timezone_set('America/New_York'); $nowDate = new \DateTime(); $hrDate = clone $nowDate;//test $tmpInterval = new \DateInterval($tmpER); $hrDate->add($tmpInterval); $tmpDate = $hrDate->format('l, M. d, Y - h:ia'); var_dump($tmpDate);
Output for 7.0.0 - 7.1.0
Notice: Undefined variable: tmpER in /in/Ui2Jf on line 6 Fatal error: Uncaught Exception: DateInterval::__construct(): Unknown or bad format () in /in/Ui2Jf:6 Stack trace: #0 /in/Ui2Jf(6): DateInterval->__construct('') #1 {main} thrown in /in/Ui2Jf on line 6
Process exited with code 255.
Output for hhvm-3.12.0
Notice: Undefined variable: tmpER in /in/Ui2Jf on line 6 Fatal error: Uncaught exception 'Exception' with message 'DateInterval::__construct: Invalid interval ()' in /in/Ui2Jf:6 Stack trace: #0 /in/Ui2Jf(6): DateInterval->__construct() #1 {main}
Process exited with code 255.
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.3.0 - 5.6.28
Notice: Undefined variable: tmpER in /in/Ui2Jf on line 6 Fatal error: Uncaught exception 'Exception' with message 'DateInterval::__construct(): Unknown or bad format ()' in /in/Ui2Jf:6 Stack trace: #0 /in/Ui2Jf(6): DateInterval->__construct('') #1 {main} thrown in /in/Ui2Jf on line 6
Process exited with code 255.
Output for 5.2.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Ui2Jf on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Ui2Jf on line 6 Fatal error: Class 'DateInterval' not found in /in/Ui2Jf on line 6
Process exited with code 255.
Output for 5.1.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Ui2Jf on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Ui2Jf on line 6 Fatal error: Class 'DateTime' not found in /in/Ui2Jf on line 4
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Ui2Jf on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Ui2Jf on line 6 Fatal error: Call to undefined function date_default_timezone_set() in /in/Ui2Jf on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Ui2Jf on line 4 Parse error: syntax error, unexpected T_VARIABLE in /in/Ui2Jf on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Ui2Jf on line 4 Parse error: parse error, unexpected T_VARIABLE in /in/Ui2Jf on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Ui2Jf on line 4 Parse error: parse error in /in/Ui2Jf on line 5
Process exited with code 255.