3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $today = date_create('now'); $later = date_modify($today, '+1 day'); echo date_format($later, 'Y-m-d'); var_dump($today, $later);
based on arnES
Output for 7.2.6
2017-07-04object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.005988" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.005988" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.0
2017-07-04object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.003431" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.003431" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.20
2017-07-04object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.003416" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.003416" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.10
2017-07-04object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.006135" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.006135" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.7
2017-07-04object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.003522" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.003522" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.6
2017-07-04object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.027868" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.027868" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.5
2017-07-04object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.021736" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.021736" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.4
2017-07-04object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.024940" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.024940" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.0.20, 7.1.3
2017-07-04object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.2
2017-07-04object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.027847" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.027847" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.1
2017-07-04object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.007146" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.007146" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.0
2017-07-04object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.007043" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.007043" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for hhvm-3.15.4
Warning: date_format() expects parameter 1 to be object, null given in /in/hGYZ8 on line 5 object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-04 12:00:48.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } NULL