3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_dump(new DateTime('last day of this month'));
Output for 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-04-30 11:37:17.006147" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.28, 7.0.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-04-30 11:37:17.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-31 04:43:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-30 17:52:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-31 03:40:48.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-31 03:58:36.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-31 14:27:59.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-31 15:06:35.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-31 16:57:35.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for hhvm-3.12.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-31 10:22:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for hhvm-3.10.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-31 00:08:29.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.21
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-31 23:46:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-30 13:07:39.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.19
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-31 02:48:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.18
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-31 16:15:03.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.17
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-31 08:24:37.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.16
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-31 18:44:04.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.15
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-31 19:36:29.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-30 22:09:55.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-30 02:09:06.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-30 15:18:23.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-30 22:33:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-30 00:11:29.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-30 05:23:49.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-30 13:11:37.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-31 01:29:26.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.35
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-31 03:24:45.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.34
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-30 19:05:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.33
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-31 14:35:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.32
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-31 20:23:52.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.31
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-31 11:16:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.30
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-31 21:37:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.29
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-30 16:13:38.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.28
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-30 18:35:58.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.27
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-30 20:59:33.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.26
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-30 02:43:35.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.25
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-30 08:42:29.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.24
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-31 15:31:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.40 - 5.4.45
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-10-31 12:35:49.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.31 - 5.4.39
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-10-31 12:35:50.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.30
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-10-31 12:35:51.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.22 - 5.4.29
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-10-31 12:35:51" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.14 - 5.4.21
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-10-31 12:35:52" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.5 - 5.4.13
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-10-31 12:35:53" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.26 - 5.4.4
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-10-31 12:35:54" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.19 - 5.3.25
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-10-31 12:35:55" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.10 - 5.3.18
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-10-31 12:35:56" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.3 - 5.3.9
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-10-31 12:35:57" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.0 - 5.3.2
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-10-31 12:35:58" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.2.0 - 5.2.17
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (last day of this month) at position 9 (o): The timezone could not be found in the database' in /in/hcRdi:2 Stack trace: #0 /in/hcRdi(2): DateTime->__construct('last day of thi...') #1 {main} thrown in /in/hcRdi on line 2
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/hcRdi on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/hcRdi on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/hcRdi on line 2