3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $d1 = new DateTime('now+02:00'); $d1->setTimezone(new DateTimeZone(date_default_timezone_get())); $d2 = new DateTime(); var_dump($d1,$d2,date_default_timezone_get());
based on 7fDBn
Output for 7.2.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-11-05 07:39:16.026026" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-11-05 08:39:16.026091" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 7.1.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-11-05 07:39:16.004870" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-11-05 08:39:16.004956" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 7.1.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-11-05 07:39:16.002567" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-11-05 08:39:16.002606" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 7.1.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-11-05 07:39:16.012116" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-11-05 08:39:16.012188" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 7.1.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-11-05 07:39:16.011664" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-11-05 08:39:16.011739" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-11-05 07:39:16.003900" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-11-05 08:39:16.003941" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.6.28, 7.0.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-11-05 07:39:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-11-05 08:39:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 7.0.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-03 18:22:32.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-05-03 18:22:32.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 7.0.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-03 06:48:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-03 06:48:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 7.0.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-10 17:34:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-10 18:34:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 7.0.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-18 18:42:23.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-18 19:42:23.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 7.0.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-23 00:49:48.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-23 01:49:48.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 7.0.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-24 04:30:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-24 05:30:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 7.0.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-27 07:26:22.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-27 07:26:22.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.6.21
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-02 13:31:50.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-05-02 13:31:50.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.6.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-10 05:47:26.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-10 05:47:26.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.6.19
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-08 01:45:35.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-08 02:45:35.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.6.18
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-15 10:28:42.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-15 11:28:42.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.6.17
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-19 22:08:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-19 23:08:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.6.16
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-28 08:13:40.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-28 08:13:40.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.6.15
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-29 09:04:24.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-29 09:04:24.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.6.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-02 10:55:41.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-02 10:55:41.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.6.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-15 15:19:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-15 15:19:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.6.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-20 05:48:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-20 05:48:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.6.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-24 12:10:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-24 12:10:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.6.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-25 14:13:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-25 14:13:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.6.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-27 19:23:59.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-27 19:23:59.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.6.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-30 04:16:21.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-30 04:16:21.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.5.35
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-22 20:28:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-05-22 20:28:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.5.34
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-11 07:59:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-11 07:59:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.5.33
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-09 04:27:47.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-09 05:27:47.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.5.32
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-17 14:23:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-17 15:23:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.5.31
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-21 01:09:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-21 02:09:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.5.30
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-01 10:57:50.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-01 10:57:50.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.5.29
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-17 05:43:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-17 05:43:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.5.28
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-21 09:01:49.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-21 09:01:49.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.5.27
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-22 10:49:03.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-22 10:49:03.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.5.26
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-26 16:56:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-26 16:56:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.5.25
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-28 23:48:59.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-28 23:48:59.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.5.24
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-24 06:22:19.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-05-24 06:22:19.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.4.41 - 5.4.45
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-11-05 07:39:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-11-05 08:39:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.4.35 - 5.4.40
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-11-05 07:39:29.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-11-05 08:39:29.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.4.30 - 5.4.34
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-11-05 07:39:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-11-05 08:39:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.4.28 - 5.4.29
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-11-05 07:39:30" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(19) "2015-11-05 08:39:30" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.4.22 - 5.4.27
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-11-05 07:39:31" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(19) "2015-11-05 08:39:31" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.4.15 - 5.4.21
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-11-05 07:39:32" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(19) "2015-11-05 08:39:32" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.4.8 - 5.4.14
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-11-05 07:39:33" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(19) "2015-11-05 08:39:33" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.4.2 - 5.4.7
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-11-05 07:39:34" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(19) "2015-11-05 08:39:34" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.3.26 - 5.4.1
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-11-05 07:39:35" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(19) "2015-11-05 08:39:35" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"
Output for 5.3.19 - 5.3.25
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-11-05 07:39:36" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(19) "2015-11-05 08:39:36" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(16) "Europe/Amsterdam"