3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date = DateTime::createFromFormat('D M m Y H:i:s T +', 'Fri May 09 2014 11:00:00 GMT 0200'); $errors = date_get_last_errors(); var_dump($date, $errors);
Output for 5.5.29, 5.5.32, 5.6.13, 5.6.17 - 5.6.18, 5.6.28, 7.0.3, 7.0.12 - 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-09-19 11:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" } array(4) { ["warning_count"]=> int(1) ["warnings"]=> array(1) { [29]=> string(13) "Trailing data" } ["error_count"]=> int(0) ["errors"]=> array(0) { } }
Output for 5.5.30, 5.6.14, 5.6.21, 7.0.5 - 7.0.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-09-05 11:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" } array(4) { ["warning_count"]=> int(1) ["warnings"]=> array(1) { [29]=> string(13) "Trailing data" } ["error_count"]=> int(0) ["errors"]=> array(0) { } }
Output for 5.5.33 - 5.5.34, 5.6.19 - 5.6.20, 7.0.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-09-12 11:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" } array(4) { ["warning_count"]=> int(1) ["warnings"]=> array(1) { [29]=> string(13) "Trailing data" } ["error_count"]=> int(0) ["errors"]=> array(0) { } }
Output for 5.4.30 - 5.5.24, 5.5.26 - 5.5.28, 5.5.31, 5.5.35, 5.6.10 - 5.6.12, 7.0.1 - 7.0.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-09-26 11:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" } array(4) { ["warning_count"]=> int(1) ["warnings"]=> array(1) { [29]=> string(13) "Trailing data" } ["error_count"]=> int(0) ["errors"]=> array(0) { } }
Output for 5.5.25, 5.6.8 - 5.6.9, 5.6.15 - 5.6.16, 7.0.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-10-03 11:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" } array(4) { ["warning_count"]=> int(1) ["warnings"]=> array(1) { [29]=> string(13) "Trailing data" } ["error_count"]=> int(0) ["errors"]=> array(0) { } }
Output for 5.3.9 - 5.4.29
object(DateTime)#1 (3) { ["date"]=> string(19) "2014-09-26 11:00:00" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" } array(4) { ["warning_count"]=> int(1) ["warnings"]=> array(1) { [29]=> string(13) "Trailing data" } ["error_count"]=> int(0) ["errors"]=> array(0) { } }
Output for 5.3.0 - 5.3.8
bool(false) array(4) { ["warning_count"]=> int(0) ["warnings"]=> array(0) { } ["error_count"]=> int(2) ["errors"]=> array(2) { [29]=> string(35) "The format separator does not match" [30]=> string(13) "Trailing data" } }
Output for 5.2.10 - 5.2.17
Fatal error: Call to undefined method DateTime::createFromFormat() in /in/punpQ on line 3
Process exited with code 255.
Output for 5.2.0 - 5.2.9
Fatal error: Call to undefined method DateTime::createfromformat() in /in/punpQ on line 3
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/punpQ on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Undefined class name 'datetime' in /in/punpQ on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Undefined class name 'datetime' in /in/punpQ on line 3