3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date = new \DateTime(); $date = (array) $date; var_dump($date);
Output for 7.1.0
array(3) { ["date"]=> string(26) "2014-03-17 18:26:12.005986" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.28, 7.0.14
array(3) { ["date"]=> string(26) "2014-03-17 18:26:12.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.6
array(3) { ["date"]=> string(26) "2016-05-03 12:52:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.5
array(3) { ["date"]=> string(26) "2016-04-03 01:35:17.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.4
array(3) { ["date"]=> string(26) "2016-03-10 12:20:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.3
array(3) { ["date"]=> string(26) "2016-03-18 13:08:51.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.2
array(3) { ["date"]=> string(26) "2016-03-22 19:04:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.1
array(3) { ["date"]=> string(26) "2016-03-23 23:22:22.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.0
array(3) { ["date"]=> string(26) "2016-03-27 00:59:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for hhvm-3.12.0
array(3) { ["date"]=> string(26) "2016-03-12 17:38:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for hhvm-3.10.0
array(3) { ["date"]=> string(26) "2016-03-30 16:40:36.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.21
array(3) { ["date"]=> string(26) "2016-05-02 08:04:32.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.20
array(3) { ["date"]=> string(26) "2016-04-10 00:28:35.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.19
array(3) { ["date"]=> string(26) "2016-03-07 20:24:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.18
array(3) { ["date"]=> string(26) "2016-03-15 05:03:40.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.17
array(3) { ["date"]=> string(26) "2016-03-19 17:13:06.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.16
array(3) { ["date"]=> string(26) "2016-03-28 02:49:26.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.15
array(3) { ["date"]=> string(26) "2016-03-29 03:45:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.14
array(3) { ["date"]=> string(26) "2016-04-02 05:54:06.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.13
array(3) { ["date"]=> string(26) "2016-04-15 09:54:49.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.12
array(3) { ["date"]=> string(26) "2016-04-19 23:54:29.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.11
array(3) { ["date"]=> string(26) "2016-04-23 06:49:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.10
array(3) { ["date"]=> string(26) "2016-04-25 08:36:36.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.9
array(3) { ["date"]=> string(26) "2016-04-27 13:41:29.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.8
array(3) { ["date"]=> string(26) "2016-04-29 21:53:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.35
array(3) { ["date"]=> string(26) "2016-05-22 11:50:42.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.34
array(3) { ["date"]=> string(26) "2016-04-11 02:46:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.33
array(3) { ["date"]=> string(26) "2016-03-08 23:19:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.32
array(3) { ["date"]=> string(26) "2016-03-17 07:51:03.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.31
array(3) { ["date"]=> string(26) "2016-03-20 19:56:05.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.30
array(3) { ["date"]=> string(26) "2016-04-01 05:38:56.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.29
array(3) { ["date"]=> string(26) "2016-04-17 00:03:21.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.28
array(3) { ["date"]=> string(26) "2016-04-21 03:17:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.27
array(3) { ["date"]=> string(26) "2016-04-22 05:29:12.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.26
array(3) { ["date"]=> string(26) "2016-04-26 11:13:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.25
array(3) { ["date"]=> string(26) "2016-04-28 17:37:11.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.24
array(3) { ["date"]=> string(26) "2016-05-24 00:49:47.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.42 - 5.4.45
array(3) { ["date"]=> string(26) "2015-10-15 00:24:18.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.37 - 5.4.41
array(3) { ["date"]=> string(26) "2015-10-15 00:24:19.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.31 - 5.4.36
array(3) { ["date"]=> string(26) "2015-10-15 00:24:20.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.30
array(3) { ["date"]=> string(26) "2015-10-15 00:24:21.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.27 - 5.4.29
array(3) { ["date"]=> string(19) "2015-10-15 00:24:21" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.21 - 5.4.26
array(3) { ["date"]=> string(19) "2015-10-15 00:24:22" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.10 - 5.4.20
array(3) { ["date"]=> string(19) "2015-10-15 00:24:23" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.0 - 5.4.9
array(3) { ["date"]=> string(19) "2015-10-15 00:24:24" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.22 - 5.3.29
array(3) { ["date"]=> string(19) "2015-10-15 00:24:25" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.16 - 5.3.21
array(3) { ["date"]=> string(19) "2015-10-15 00:24:26" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.11 - 5.3.15
array(3) { ["date"]=> string(19) "2015-10-15 00:24:27" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.5 - 5.3.10
array(3) { ["date"]=> string(19) "2015-10-15 00:24:28" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.0 - 5.3.4
array(3) { ["date"]=> string(19) "2015-10-15 00:24:29" ["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/aWrHl on line 3 array(0) { }
Output for 5.0.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/aWrHl on line 3 Fatal error: Class 'DateTime' not found in /in/aWrHl 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/aWrHl on line 3 Fatal error: Cannot instantiate non-existent class: datetime in /in/aWrHl 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/aWrHl on line 3 Fatal error: Cannot instantiate non-existent class: datetime in /in/aWrHl on line 3