3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $today = new DateTime(); $today2 = $today->format('Y-m-d H:i:s'); var_dump(date('Y-m-d H:i:s'), $today, $today);
based on DQF12
Output for 7.2.0
string(19) "2015-10-05 13:47:55" object(DateTime)#1 (3) { ["date"]=> string(26) "2015-10-05 13:47:55.003686" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#1 (3) { ["date"]=> string(26) "2015-10-05 13:47:55.003686" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.10
string(19) "2015-10-05 13:47:55" object(DateTime)#1 (3) { ["date"]=> string(26) "2015-10-05 13:47:55.002989" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#1 (3) { ["date"]=> string(26) "2015-10-05 13:47:55.002989" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.7
string(19) "2015-10-05 13:47:55" object(DateTime)#1 (3) { ["date"]=> string(26) "2015-10-05 13:47:55.003660" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#1 (3) { ["date"]=> string(26) "2015-10-05 13:47:55.003660" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.6
string(19) "2015-10-05 13:47:55" object(DateTime)#1 (3) { ["date"]=> string(26) "2015-10-05 13:47:55.005527" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#1 (3) { ["date"]=> string(26) "2015-10-05 13:47:55.005527" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.5
string(19) "2015-10-05 13:47:55" object(DateTime)#1 (3) { ["date"]=> string(26) "2015-10-05 13:47:55.011446" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#1 (3) { ["date"]=> string(26) "2015-10-05 13:47:55.011446" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.0
string(19) "2015-10-05 13:47:55" object(DateTime)#1 (3) { ["date"]=> string(26) "2015-10-05 13:47:55.003977" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#1 (3) { ["date"]=> string(26) "2015-10-05 13:47:55.003977" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.30 - 5.4.45, 5.5.14 - 7.0.20
string(19) "2015-10-05 13:47:55" object(DateTime)#1 (3) { ["date"]=> string(26) "2015-10-05 13:47:55.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#1 (3) { ["date"]=> string(26) "2015-10-05 13:47:55.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.0 - 5.4.29, 5.5.0 - 5.5.13
string(19) "2015-10-05 13:47:55" object(DateTime)#1 (3) { ["date"]=> string(19) "2015-10-05 13:47:55" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#1 (3) { ["date"]=> string(19) "2015-10-05 13:47:55" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }