3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime(); var_dump($date); $dateStr = (string) $date->format('l, j F, Y'); echo $dateStr;
Output for 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2013-10-02 13:32:25.006198" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Wednesday, 2 October, 2013
Output for 5.6.28, 7.0.12 - 7.0.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2013-10-02 13:32:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Wednesday, 2 October, 2013
Output for 7.0.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-03 01:04:56.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Tuesday, 3 May, 2016
Output for 7.0.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-02 14:25:32.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 2 April, 2016
Output for 5.5.32, 5.6.17 - 5.6.19, 7.0.3 - 7.0.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-12 09:52:06.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.5.31, 5.6.15 - 5.6.16, 7.0.0 - 7.0.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-12 09:52:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.6.21
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-01 20:09:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Sunday, 1 May, 2016
Output for 5.6.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-09 09:40:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 9 April, 2016
Output for 5.4.45, 5.5.29 - 5.5.30, 5.6.13 - 5.6.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-12 09:52:08.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.4.44, 5.5.28, 5.6.11 - 5.6.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-12 09:52:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.4.41 - 5.4.43, 5.5.26 - 5.5.27, 5.6.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-12 09:52:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.5.24 - 5.5.25, 5.6.8 - 5.6.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-12 09:52:11.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.4.39 - 5.4.40, 5.5.23, 5.6.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-12 09:52:12.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.4.37 - 5.4.38, 5.5.21 - 5.5.22, 5.6.5 - 5.6.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-12 09:52:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.4.35 - 5.4.36, 5.5.19 - 5.5.20, 5.6.3 - 5.6.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-12 09:52:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.4.34, 5.5.16 - 5.5.18, 5.6.0 - 5.6.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-12 09:52:15.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.5.35
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-21 23:14:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 21 May, 2016
Output for 5.5.34
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-10 15:32:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Sunday, 10 April, 2016
Output for 5.5.33
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-12 09:52:05.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.4.30 - 5.4.32, 5.5.14 - 5.5.15
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-12 09:52:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.4.27 - 5.4.29, 5.5.11 - 5.5.13
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-12 09:52:17" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.4.23 - 5.4.26, 5.5.8 - 5.5.10
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-12 09:52:18" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.3.28, 5.4.20 - 5.4.22, 5.5.5 - 5.5.7
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-12 09:52:19" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.4.18 - 5.4.19, 5.5.1 - 5.5.4
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-12 09:52:20" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.3.26 - 5.3.27, 5.4.15 - 5.4.17, 5.5.0
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-12 09:52:21" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.3.23 - 5.3.25, 5.4.12 - 5.4.14
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-12 09:52:22" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.3.19 - 5.3.22, 5.4.9 - 5.4.11
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-12 09:52:23" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.3.15 - 5.3.18, 5.4.6 - 5.4.8
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-12 09:52:24" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.3.12 - 5.3.14, 5.4.3 - 5.4.5
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-12 09:52:25" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.3.9 - 5.3.11, 5.4.0 - 5.4.2
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-12 09:52:26" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.3.29
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-12 09:52:16" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.3.5 - 5.3.8
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-12 09:52:27" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.3.2 - 5.3.4
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-12 09:52:28" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.3.0 - 5.3.1
object(DateTime)#1 (3) { ["date"]=> string(19) "2016-03-12 09:52:29" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Saturday, 12 March, 2016
Output for 5.2.0 - 5.2.17
object(DateTime)#1 (0) { } Saturday, 12 March, 2016
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/KKkc0 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/KKkc0 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/KKkc0 on line 3