3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = new \DateTime(); $date->setDate(2014, 1, 1); print_r($date->modify('last day of this year'));
based on u9ZaR
Output for 7.2.0
DateTime Object ( [date] => 2014-01-31 11:36:39.002892 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.1.10
DateTime Object ( [date] => 2014-01-31 11:36:39.003084 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.1.7
DateTime Object ( [date] => 2014-01-31 11:36:39.002795 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.1.6
DateTime Object ( [date] => 2014-01-31 11:36:39.010674 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.1.5
DateTime Object ( [date] => 2014-01-31 11:36:39.006112 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.1.0
DateTime Object ( [date] => 2014-01-31 11:36:39.003827 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.28, 7.0.20
DateTime Object ( [date] => 2014-01-31 11:36:39.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.6
DateTime Object ( [date] => 2014-01-31 17:38:03.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.5
DateTime Object ( [date] => 2014-01-31 06:06:11.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.4
DateTime Object ( [date] => 2014-01-31 17:48:07.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.3
DateTime Object ( [date] => 2014-01-31 18:36:44.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.2
DateTime Object ( [date] => 2014-01-31 00:59:38.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.1
DateTime Object ( [date] => 2014-01-31 04:46:53.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.0
DateTime Object ( [date] => 2014-01-31 06:43:33.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.21
DateTime Object ( [date] => 2014-01-31 12:48:15.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.20
DateTime Object ( [date] => 2014-01-31 05:05:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.19
DateTime Object ( [date] => 2014-01-31 01:58:07.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.18
DateTime Object ( [date] => 2014-01-31 10:32:14.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.17
DateTime Object ( [date] => 2014-01-31 22:22:12.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.16
DateTime Object ( [date] => 2014-01-31 07:30:51.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.15
DateTime Object ( [date] => 2014-01-31 08:21:58.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.14
DateTime Object ( [date] => 2014-01-31 10:16:01.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.13
DateTime Object ( [date] => 2014-01-31 14:36:22.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.12
DateTime Object ( [date] => 2014-01-31 05:04:32.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.11
DateTime Object ( [date] => 2014-01-31 11:19:39.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.10
DateTime Object ( [date] => 2014-01-31 13:30:16.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.9
DateTime Object ( [date] => 2014-01-31 18:39:21.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.8
DateTime Object ( [date] => 2014-01-31 03:31:51.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.35
DateTime Object ( [date] => 2014-01-31 18:56:39.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.34
DateTime Object ( [date] => 2014-01-31 07:17:58.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.33
DateTime Object ( [date] => 2014-01-31 04:35:53.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.32
DateTime Object ( [date] => 2014-01-31 14:14:38.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.31
DateTime Object ( [date] => 2014-01-31 01:19:46.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.30
DateTime Object ( [date] => 2014-01-31 10:15:17.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.29
DateTime Object ( [date] => 2014-01-31 05:00:54.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.28
DateTime Object ( [date] => 2014-01-31 08:16:55.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.27
DateTime Object ( [date] => 2014-01-31 10:07:13.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.26
DateTime Object ( [date] => 2014-01-31 16:12:26.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.25
DateTime Object ( [date] => 2014-01-31 23:03:30.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.24
DateTime Object ( [date] => 2014-01-31 05:40:29.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.40 - 5.4.45
DateTime Object ( [date] => 2014-01-31 11:36:51.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.34 - 5.4.39
DateTime Object ( [date] => 2014-01-31 11:36:52.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.30 - 5.4.32
DateTime Object ( [date] => 2014-01-31 11:36:53.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.27 - 5.4.29
DateTime Object ( [date] => 2014-01-31 11:36:53 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.19 - 5.4.26
DateTime Object ( [date] => 2014-01-31 11:36:54 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.13 - 5.4.18
DateTime Object ( [date] => 2014-01-31 11:36:55 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.8 - 5.4.12
DateTime Object ( [date] => 2014-01-31 11:36:56 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.7
DateTime Object ( [date] => 2014-01-31 01:16:12 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.6
DateTime Object ( [date] => 2014-01-31 02:29:22 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.5
DateTime Object ( [date] => 2014-01-31 03:58:59 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.4
DateTime Object ( [date] => 2014-01-31 05:25:45 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.3
DateTime Object ( [date] => 2014-01-31 07:04:29 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.2
DateTime Object ( [date] => 2014-01-31 08:47:04 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.1
DateTime Object ( [date] => 2014-01-31 10:35:28 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.29
DateTime Object ( [date] => 2014-01-31 06:49:31 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.28
DateTime Object ( [date] => 2014-01-31 08:54:52 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.27
DateTime Object ( [date] => 2014-01-31 07:54:29 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.26
DateTime Object ( [date] => 2014-01-31 09:50:07 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.25
DateTime Object ( [date] => 2014-01-31 09:56:37 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.24
DateTime Object ( [date] => 2014-01-31 11:14:12 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.23
DateTime Object ( [date] => 2014-01-31 12:36:18 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.22
DateTime Object ( [date] => 2014-01-31 14:00:35 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.21
DateTime Object ( [date] => 2014-01-31 15:33:02 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.20
DateTime Object ( [date] => 2014-01-31 16:31:32 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.19
DateTime Object ( [date] => 2014-01-31 17:48:49 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.18
DateTime Object ( [date] => 2014-01-31 18:50:04 [timezone_type] => 3 [timezone] => Europe/Amsterdam )