3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(new \DateTime('+1 year'));
Output for 7.3.0rc4
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-04-24 16:27:18.002484" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.0rc3
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-04-24 16:27:18.033845" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.0beta1
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-04-24 16:27:18.002525" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.0alpha1
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-04-24 16:27:18.058471" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-04-24 16:27:18.002651" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-04-24 16:27:18.008617" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-04-24 16:27:18.011662" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-04-24 16:27:18.010836" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-04-24 16:27:18.011665" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-05-20 11:39:58.004146" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-04-24 16:27:18.172313" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.16
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-04-24 16:27:18.013792" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.15
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-04-24 16:27:18.013467" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-04-24 16:27:18.013035" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-04-24 16:27:18.006929" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-04-24 16:27:18.009586" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-04-24 16:27:18.007437" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-05-20 11:39:58.003970" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-04-24 16:27:18.011068" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-04-24 16:27:18.012967" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-05-20 11:39:58.002831" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-05-20 11:39:58.012628" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-05-20 11:39:58.010621" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-04-24 16:27:18.038752" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.14 - 5.5.23, 5.5.36 - 5.6.6, 5.6.22 - 5.6.27, 5.6.29 - 5.6.30, hhvm-3.10.1 - 3.11.1, hhvm-3.13.2, hhvm-3.17.3 - 3.21.3, 7.0.7 - 7.0.13, 7.0.15 - 7.0.16, 7.0.18 - 7.0.19, 7.0.21 - 7.0.29, 7.1.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-04-24 16:27:18.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-04-24 16:27:18.026680" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-04-24 16:27:18.011074" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-05-20 11:39:58.006154" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.28, 7.0.14, 7.0.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-05-20 11:39:58.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for hhvm-3.12.14, hhvm-3.15.4, hhvm-3.22.0, 7.0.17
object(DateTime)#1 (3) { ["date"]=> string(26) "2019-04-24 16:27:19.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-05-02 23:42:20.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-04-02 13:18:08.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-03-09 22:09:55.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-03-17 22:33:12.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-03-21 09:17:44.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-03-23 08:55:49.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-03-26 12:07:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.21
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-05-01 18:48:20.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-04-09 08:35:01.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.19
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-03-06 19:18:51.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.18
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-03-14 07:32:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.17
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-03-19 03:09:33.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.16
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-03-27 13:49:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.15
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-03-28 14:41:49.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-04-01 17:32:29.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-04-14 21:29:33.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-04-19 10:29:55.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-04-22 17:50:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-04-24 19:28:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-04-27 00:25:24.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-04-29 08:06:05.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-05-24 17:36:32.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.35
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-05-21 21:55:59.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.34
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-04-10 13:59:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.33
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-03-08 09:16:49.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.32
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-03-15 18:19:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.31
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-03-20 06:03:58.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.30
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-03-31 16:52:50.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.29
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-04-16 11:27:38.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.28
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-04-20 13:34:04.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.27
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-04-21 16:21:15.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.26
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-04-25 21:41:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.25
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-04-28 03:46:44.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.24
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-04-30 11:30:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.0 - 5.5.13
object(DateTime)#1 (3) { ["date"]=> string(19) "2019-04-24 16:27:18" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.45
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-09-10 23:13:51.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.44
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-08-31 10:04:12.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.43
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-08-31 10:04:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.42
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-08-31 10:04:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.41
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-08-31 10:04:05.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.40
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-01 20:22:44.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.39
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-01 20:22:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.38
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-02-28 15:43:18.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.37
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-02-05 01:09:32.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.36
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-02-05 01:09:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.35
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-11-15 15:07:33.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.34
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-11-15 15:07:32.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.32
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-08-30 06:25:29.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.31
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-08-30 06:25:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.30
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-08-30 06:25:23.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.29
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-08-30 06:25:23" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.16 - 5.4.28
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-05-20 11:40:00" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.5 - 5.4.15
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-05-20 11:40:01" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.19 - 5.3.28, 5.4.0 - 5.4.4
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-05-20 11:40:02" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.29
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-08-30 06:25:24" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.6 - 5.3.18
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-05-20 11:40:03" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.0 - 5.3.5
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-05-20 11:40:04" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.2.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/82CAX on line 3 object(DateTime)#1 (0) { }
Output for 5.0.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/82CAX on line 3 Fatal error: Class 'DateTime' not found in /in/82CAX on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/82CAX on line 3 Fatal error: Cannot instantiate non-existent class: datetime in /in/82CAX on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/82CAX on line 3 Fatal error: Cannot instantiate non-existent class: datetime in /in/82CAX on line 3