3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dt = new DateTime(); var_dump($dt->modify(intval(4) . ' year'));
Output for 7.3.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000113" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.7, 7.2.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000087" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000132" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.5, 7.2.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000105" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000099" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000126" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000128" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000125" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000106" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000108" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000085" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000130" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.4, 7.1.9, 7.2.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000091" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.16, 7.2.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000110" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.25
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000114" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.24
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000098" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.1, 7.1.19, 7.1.23
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000107" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.12, 7.1.22
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000116" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.21
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000095" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000118" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.18
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000156" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.10, 7.1.17
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000094" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.15
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000096" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.2, 7.1.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000103" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.6, 7.1.11, 7.1.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000102" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000104" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000123" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.30 - 5.4.45, 5.5.14 - 7.0.33, 7.1.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-08-19 17:01:20.000088" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.0 - 5.4.29, 5.5.0 - 5.5.13
object(DateTime)#1 (3) { ["date"]=> string(19) "2018-08-19 17:01:20" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.2.0 - 5.2.17
NULL
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/q3I4O on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/q3I4O on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/q3I4O on line 3