3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime(); $date->setTimezone(new DateTimeZone('America/New_York')); $date->modify('fourth day next month'); var_dump($date);
based on o1Ye9
Output for 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-11-02 10:28:12.003968" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.6.28, 7.0.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-11-02 10:28:12.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 7.0.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-06-07 02:42:26.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 7.0.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-06 15:37:49.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 7.0.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 02:00:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 7.0.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-22 03:34:18.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 7.0.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-26 09:20:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 7.0.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-27 14:20:33.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 7.0.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-30 15:55:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for hhvm-3.12.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-04 08:55:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.21
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-06-05 22:03:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.6.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-13 14:32:06.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.6.19
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-11 10:08:05.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.6.18
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-18 18:53:37.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.6.17
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-23 07:52:20.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.6.16
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-01 16:41:22.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.6.15
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-02 17:34:11.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.6.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-05 20:09:22.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.6.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-19 00:03:39.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.6.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-23 13:42:55.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.6.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-26 20:49:12.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.6.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-28 22:32:34.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.6.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-31 03:30:12.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.6.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-06-02 11:31:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.6.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-06-29 07:00:49.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.5.35
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-06-26 01:46:23.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.5.34
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-14 16:54:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.5.33
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-12 12:56:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.5.32
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-20 20:45:38.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.5.31
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-24 10:38:38.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.5.30
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-05 19:42:18.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.5.29
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-20 14:09:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.5.28
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-24 16:49:05.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.5.27
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-25 19:19:55.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.5.26
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-30 00:58:49.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.5.25
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-06-01 07:03:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.5.24
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-06-27 14:17:06.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.4.41 - 5.4.45
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-11-17 16:18:19.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.4.37 - 5.4.40
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-11-17 16:18:20.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.4.31 - 5.4.36
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-11-17 16:18:21.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.4.30
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-11-17 16:18:22.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.4.25 - 5.4.29
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-11-17 16:18:22" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.4.19 - 5.4.24
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-11-17 16:18:23" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.4.11 - 5.4.18
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-11-17 16:18:24" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.4.3 - 5.4.10
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-11-17 16:18:25" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.3.29 - 5.4.2
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-11-17 16:18:26" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.3.25 - 5.3.28
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-11-17 16:18:27" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.3.17 - 5.3.24
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-11-17 16:18:28" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.3.7 - 5.3.16
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-11-17 16:18:29" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
Output for 5.3.0 - 5.3.6
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-11-17 16:18:30" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "America/New_York" }
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/acuhN 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/acuhN 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/acuhN on line 3