3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime(); var_dump($date); $date2 = \DateTime::createFromFormat('U', $date->format('U')); var_dump($date2);
based on XPlHP
Output for 7.2.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:51:13.004064" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-12-08 16:51:13.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 7.1.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:51:13.003696" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-12-08 16:51:13.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 7.1.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:51:13.002475" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-12-08 16:51:13.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 7.1.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:51:13.010760" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-12-08 16:51:13.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 7.1.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:51:13.010828" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-12-08 16:51:13.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:51:13.004062" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-12-08 16:51:13.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.28, 7.0.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:51:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-12-08 16:51:13.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 7.0.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-21 18:32:41.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-05-21 16:32:41.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 7.0.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 15:50:03.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-14 13:50:03.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 7.0.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-10 20:27:58.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-10 19:27:58.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 7.0.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-18 21:50:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-18 20:50:16.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 7.0.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-23 04:04:36.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-23 03:04:36.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 7.0.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-24 07:18:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-24 06:18:27.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 7.0.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-27 09:12:42.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-27 07:12:42.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.21
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-02 20:48:20.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-05-02 18:48:20.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-10 12:48:34.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-10 10:48:34.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.19
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-08 04:40:06.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-08 03:40:06.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.18
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-15 13:31:32.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-15 12:31:32.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.17
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-20 01:05:59.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-20 00:05:59.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.16
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-28 10:01:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-28 08:01:27.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.15
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-29 14:59:19.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-29 12:59:19.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 20:40:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-14 18:40:53.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-15 21:28:04.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-15 19:28:04.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-20 12:29:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-20 10:29:25.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-24 18:24:51.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-24 16:24:51.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-25 20:32:19.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-25 18:32:19.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-28 02:30:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-28 00:30:02.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-30 10:19:03.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-30 08:19:03.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.5.35
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-23 09:31:38.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-05-23 07:31:38.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.5.34
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-11 15:04:41.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-11 13:04:41.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.5.33
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-09 07:34:47.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-09 06:34:47.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.5.32
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-17 17:25:57.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-17 16:25:57.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.5.31
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-21 04:12:17.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-21 03:12:17.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.5.30
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-01 16:48:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-01 14:48:31.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.5.29
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-17 11:38:06.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-17 09:38:06.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.5.28
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-21 15:19:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-21 13:19:13.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.5.27
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-22 16:50:34.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-22 14:50:34.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.5.26
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-26 23:14:20.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-26 21:14:20.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.5.25
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-29 06:48:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-29 04:48:31.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.5.24
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-24 13:56:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2016-05-24 11:56:27.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.4.44 - 5.4.45
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:51:17.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-12-08 16:51:17.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.4.42 - 5.4.43
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:51:19.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-12-08 16:51:19.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.4.40 - 5.4.41
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:51:20.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-12-08 16:51:20.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.4.37 - 5.4.39
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:51:21.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-12-08 16:51:21.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.4.34 - 5.4.36
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:51:22.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-12-08 16:51:22.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.4.30 - 5.4.32
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:51:23.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-12-08 16:51:23.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.4.25 - 5.4.29
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-12-08 17:51:24" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(19) "2015-12-08 16:51:24" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.3.28, 5.4.21 - 5.4.24
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-12-08 17:51:25" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(19) "2015-12-08 16:51:25" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.4.18 - 5.4.20
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-12-08 17:51:26" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(19) "2015-12-08 16:51:26" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.3.24 - 5.3.27, 5.4.14 - 5.4.17
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-12-08 17:51:27" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(19) "2015-12-08 16:51:27" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.3.20 - 5.3.23, 5.4.10 - 5.4.13
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-12-08 17:51:28" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(19) "2015-12-08 16:51:28" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.3.29
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-12-08 17:51:23" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(19) "2015-12-08 16:51:23" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }