3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(new DateTime('-24 hours'));
Output for 7.2.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-01-20 15:50:06.006418" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-01-20 15:50:06.003884" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-01-20 15:50:06.003487" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-01-20 15:50:06.003775" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-01-20 15:50:06.002673" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-01-20 15:50:06.013463" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-01-20 15:50:06.009180" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-01-20 15:50:06.003520" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.28, 7.0.12 - 7.0.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-01-20 15:50:06.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-20 17:09:55.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-13 14:36:29.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.32, 5.6.18, 7.0.3 - 7.0.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-11 11:04:26.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.31, 5.6.17, 7.0.0 - 7.0.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-11 11:04:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.21
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-01 19:34:59.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-09 11:38:36.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.33, 5.6.19
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-11 11:04:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.30, 5.6.14 - 5.6.16
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-11 11:04:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.44 - 5.4.45, 5.5.28 - 5.5.29, 5.6.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-11 11:04:29.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.43, 5.5.27, 5.6.11 - 5.6.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-11 11:04:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.41 - 5.4.42, 5.5.26, 5.6.9 - 5.6.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-11 11:04:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.40, 5.5.24 - 5.5.25, 5.6.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-11 11:04:32.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.38 - 5.4.39, 5.5.22 - 5.5.23, 5.6.6 - 5.6.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-11 11:04:33.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.36 - 5.4.37, 5.5.20 - 5.5.21, 5.6.4 - 5.6.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-11 11:04:34.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.34 - 5.4.35, 5.5.18 - 5.5.19, 5.6.2 - 5.6.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-11 11:04:35.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.31 - 5.4.32, 5.5.16, 5.6.0 - 5.6.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-11 11:04:36.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.35
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-22 07:50:23.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.34
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-10 13:52:19.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.30, 5.5.14 - 5.5.15
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-11 11:04:37.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.28 - 5.4.29, 5.5.12 - 5.5.13
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-11 11:04:37" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.25 - 5.4.27, 5.5.8 - 5.5.11
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-11 11:04:38" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.28, 5.4.22 - 5.4.24, 5.5.6 - 5.5.7
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-11 11:04:39" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.19 - 5.4.21, 5.5.2 - 5.5.5
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-11 11:04:40" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.27, 5.4.16 - 5.4.18, 5.5.0 - 5.5.1
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-11 11:04:41" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.23 - 5.3.26, 5.4.13 - 5.4.15
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-11 11:04:42" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.20 - 5.3.22, 5.4.10 - 5.4.12
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-11 11:04:43" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.17 - 5.3.19, 5.4.7 - 5.4.9
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-11 11:04:44" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.14 - 5.3.16, 5.4.4 - 5.4.6
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-11 11:04:45" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.11 - 5.3.13, 5.4.1 - 5.4.3
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-11 11:04:46" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.6 - 5.3.10, 5.4.0
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-11 11:04:47" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.29
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-11 11:04:36" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.3 - 5.3.5
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-11 11:04:48" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.0 - 5.3.2
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-11 11:04:49" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.2.0 - 5.2.17
object(DateTime)#1 (0) { }
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/FLIoS on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/FLIoS on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/FLIoS on line 2