3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = \DateTime::createFromFormat('c', '2014-05-28T22:02:04+02:00'); $b = new \DateTime(strtotime('2014-05-28T22:02:04+02:00')); var_dump($a,$b,date('c'));
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (1401307324) at position 7 (3): Unexpected character in /in/sTZpO:3 Stack trace: #0 /in/sTZpO(3): DateTime->__construct('1401307324') #1 {main} thrown in /in/sTZpO on line 3
Process exited with code 255.
Output for 5.3.0 - 5.6.28
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1401307324) at position 7 (3): Unexpected character' in /in/sTZpO:3 Stack trace: #0 /in/sTZpO(3): DateTime->__construct('1401307324') #1 {main} thrown in /in/sTZpO on line 3
Process exited with code 255.
Output for 5.2.10 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/sTZpO on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/sTZpO on line 3 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/sTZpO on line 2
Process exited with code 255.
Output for 5.2.0 - 5.2.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/sTZpO on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/sTZpO on line 3 Fatal error: Call to undefined method DateTime::createfromformat() in /in/sTZpO on line 2
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/sTZpO on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/sTZpO on line 3 Fatal error: Class 'DateTime' not found in /in/sTZpO on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/sTZpO on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/sTZpO on line 3 Fatal error: Undefined class name 'datetime' in /in/sTZpO on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/sTZpO on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/sTZpO on line 3 Fatal error: Undefined class name 'datetime' in /in/sTZpO on line 2