3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $eet = new DateTimeZone('Europe/Helsinki'); $msk = new DateTimeZone('Europe/Moscow'); $d = (new DateTime('now', $msk))->setTimezone($eet); $d1 = clone $d; $d->setTimezone($msk); var_dump($d, $d1);
based on JW2Ot
Output for 7.2.0
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-06 17:27:33.004169" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2015-11-06 16:27:33.004169" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 7.1.10
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-06 17:27:33.002531" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2015-11-06 16:27:33.002531" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 7.1.7
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-06 17:27:33.005050" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2015-11-06 16:27:33.005050" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 7.1.6
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-06 17:27:33.012388" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2015-11-06 16:27:33.012388" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 7.1.5
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-06 17:27:33.005597" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2015-11-06 16:27:33.005597" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 7.1.0
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-06 17:27:33.004026" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2015-11-06 16:27:33.004026" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.6.28, 7.0.20
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-06 17:27:33.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2015-11-06 16:27:33.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 7.0.6
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-03 19:26:55.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-05-03 19:26:55.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 7.0.5
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-03 07:52:19.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-03 07:52:19.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 7.0.4
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-10 20:38:55.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-10 19:38:55.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 7.0.3
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-18 21:47:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-18 20:47:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 7.0.2
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-23 03:54:40.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-23 02:54:40.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 7.0.1
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-24 07:34:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-24 06:34:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 7.0.0
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-27 08:30:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-27 08:30:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.6.21
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-02 14:36:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-05-02 14:36:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.6.20
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-10 06:51:39.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-10 06:51:39.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.6.19
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-08 04:50:15.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-08 03:50:15.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.6.18
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-15 13:33:29.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-15 12:33:29.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.6.17
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-20 01:13:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-20 00:13:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.6.16
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-28 09:18:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-28 09:18:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.6.15
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-29 10:08:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-29 10:08:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.6.14
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-02 11:59:52.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-02 11:59:52.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.6.13
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-15 16:23:59.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-15 16:23:59.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.6.12
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-20 06:53:01.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-20 06:53:01.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.6.11
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-24 13:15:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-24 13:15:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.6.10
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-25 15:18:20.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-25 15:18:20.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.6.9
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-27 20:28:26.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-27 20:28:26.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.6.8
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-30 05:20:38.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-30 05:20:38.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.5.35
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-22 21:43:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-05-22 21:43:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.5.34
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-11 09:03:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-11 09:03:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.5.33
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-09 07:33:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-09 06:33:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.5.32
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-17 17:28:44.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-17 16:28:44.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.5.31
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-21 04:14:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-21 03:14:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.5.30
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-01 12:02:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-01 12:02:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.5.29
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-17 06:47:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-17 06:47:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.5.28
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-21 10:06:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-21 10:06:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.5.27
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-22 11:53:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-22 11:53:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.5.26
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-26 18:01:03.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-26 18:01:03.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.5.25
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-29 00:53:40.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-29 00:53:40.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.5.24
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-24 07:26:33.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-05-24 07:26:33.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.4.41 - 5.4.45
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-06 17:27:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2015-11-06 16:27:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.4.34 - 5.4.40
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-06 17:27:44.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2015-11-06 16:27:44.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.4.30 - 5.4.32
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-06 18:27:45.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2015-11-06 16:27:45.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.4.25 - 5.4.29
object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-06 18:27:45" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(19) "2015-11-06 16:27:45" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.4.17 - 5.4.24
object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-06 18:27:46" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(19) "2015-11-06 16:27:46" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.4.9 - 5.4.16
object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-06 18:27:47" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(19) "2015-11-06 16:27:47" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.4.1 - 5.4.8
object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-06 18:27:48" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(19) "2015-11-06 16:27:48" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.4.0
object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-06 18:27:49" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(19) "2015-11-06 16:27:49" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/WJj9H on line 5
Process exited with code 255.