3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $yesterday = new DateTime('- 1 day', new DateTimeZone('Pacific/Wake')); var_dump($yesterday);
Output for 7.3.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.000164" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.3.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.000154" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.2.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.000197" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.2.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.015506" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.2.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.009792" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.2.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.008773" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.2.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.009048" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.2.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.009020" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.2.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.010664" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.2.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.015677" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.2.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.014723" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.2.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.017285" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.2.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.010708" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.2.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.011381" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.2.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.011019" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.2.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.002709" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.25
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.000174" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.24
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.019570" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.23
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.017098" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.22
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.017284" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.21
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.017734" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.017294" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.19
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.021597" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.18
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.006147" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.17
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.036032" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.16
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.003632" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.15
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.010104" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.000177" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.006782" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.010686" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.009091" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.022064" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.000334" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.005492" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.013428" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.003040" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.000346" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.017760" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 5.4.30 - 5.4.45, 5.5.14 - 5.6.6, 5.6.8 - 5.6.38, hhvm-3.10.1 - 3.12.14, hhvm-3.15.4, hhvm-3.18.4 - 3.21.0, hhvm-3.22.0, 7.0.0 - 7.0.33, 7.1.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.022694" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.000238" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:31.000223" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 5.6.7, hhvm-3.13.2, hhvm-3.17.3, hhvm-3.21.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-01-12 07:06:32.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
Output for 5.3.0 - 5.4.29, 5.5.0 - 5.5.13
object(DateTime)#1 (3) { ["date"]=> string(19) "2019-01-12 07:06:31" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Pacific/Wake" }
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/8554e 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/8554e 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/8554e on line 2