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 december this year'));
based on vJFHo
Output for 7.2.0
DateTime Object ( [date] => 2014-12-31 11:37:54.004186 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.1.10
DateTime Object ( [date] => 2014-12-31 11:37:54.003257 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.1.7
DateTime Object ( [date] => 2014-12-31 11:37:54.003511 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.1.6
DateTime Object ( [date] => 2014-12-31 11:37:54.012780 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.1.5
DateTime Object ( [date] => 2014-12-31 11:37:54.009886 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.1.0
DateTime Object ( [date] => 2014-12-31 11:37:54.003942 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.28, 7.0.20
DateTime Object ( [date] => 2014-12-31 11:37:54.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.6
DateTime Object ( [date] => 2014-12-31 17:38:19.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.5
DateTime Object ( [date] => 2014-12-31 06:06:30.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.4
DateTime Object ( [date] => 2014-12-31 17:48:28.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.3
DateTime Object ( [date] => 2014-12-31 18:37:04.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.2
DateTime Object ( [date] => 2014-12-31 00:59:59.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.1
DateTime Object ( [date] => 2014-12-31 04:47:11.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.0
DateTime Object ( [date] => 2014-12-31 06:43:53.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.21
DateTime Object ( [date] => 2014-12-31 12:48:32.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.20
DateTime Object ( [date] => 2014-12-31 05:05:17.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.19
DateTime Object ( [date] => 2014-12-31 01:58:26.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.18
DateTime Object ( [date] => 2014-12-31 10:32:37.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.17
DateTime Object ( [date] => 2014-12-31 22:22:33.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.16
DateTime Object ( [date] => 2014-12-31 07:31:09.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.15
DateTime Object ( [date] => 2014-12-31 08:22:16.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.14
DateTime Object ( [date] => 2014-12-31 10:16:17.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.13
DateTime Object ( [date] => 2014-12-31 14:36:40.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.12
DateTime Object ( [date] => 2014-12-31 05:04:51.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.11
DateTime Object ( [date] => 2014-12-31 11:19:58.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.10
DateTime Object ( [date] => 2014-12-31 13:30:34.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.9
DateTime Object ( [date] => 2014-12-31 18:39:39.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.8
DateTime Object ( [date] => 2014-12-31 03:32:07.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.35
DateTime Object ( [date] => 2014-12-31 18:57:13.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.34
DateTime Object ( [date] => 2014-12-31 07:18:14.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.33
DateTime Object ( [date] => 2014-12-31 04:36:10.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.32
DateTime Object ( [date] => 2014-12-31 14:15:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.31
DateTime Object ( [date] => 2014-12-31 01:20:12.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.30
DateTime Object ( [date] => 2014-12-31 10:15:36.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.29
DateTime Object ( [date] => 2014-12-31 05:01:10.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.28
DateTime Object ( [date] => 2014-12-31 08:17:11.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.27
DateTime Object ( [date] => 2014-12-31 10:07:31.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.26
DateTime Object ( [date] => 2014-12-31 16:12:45.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.25
DateTime Object ( [date] => 2014-12-31 23:03:48.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.24
DateTime Object ( [date] => 2014-12-31 05:40:46.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.43 - 5.4.45
DateTime Object ( [date] => 2014-12-31 11:38:05.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.36 - 5.4.42
DateTime Object ( [date] => 2014-12-31 11:38:06.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.30 - 5.4.35
DateTime Object ( [date] => 2014-12-31 11:38:07.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.28 - 5.4.29
DateTime Object ( [date] => 2014-12-31 11:38:07 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.22 - 5.4.27
DateTime Object ( [date] => 2014-12-31 11:38:08 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.16 - 5.4.21
DateTime Object ( [date] => 2014-12-31 11:38:09 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.9 - 5.4.15
DateTime Object ( [date] => 2014-12-31 11:38:10 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.8
DateTime Object ( [date] => 2014-12-31 11:38:11 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.7
DateTime Object ( [date] => 2014-12-31 01:16:25 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.6
DateTime Object ( [date] => 2014-12-31 02:29:37 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.5
DateTime Object ( [date] => 2014-12-31 03:59:12 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.4
DateTime Object ( [date] => 2014-12-31 05:25:59 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.3
DateTime Object ( [date] => 2014-12-31 07:04:42 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.2
DateTime Object ( [date] => 2014-12-31 08:47:17 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.1
DateTime Object ( [date] => 2014-12-31 10:35:43 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.29
DateTime Object ( [date] => 2014-12-31 06:50:18 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.28
DateTime Object ( [date] => 2014-12-31 08:55:37 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.27
DateTime Object ( [date] => 2014-12-31 07:55:15 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.26
DateTime Object ( [date] => 2014-12-31 09:50:37 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.25
DateTime Object ( [date] => 2014-12-31 09:57:07 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.24
DateTime Object ( [date] => 2014-12-31 11:14:27 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.23
DateTime Object ( [date] => 2014-12-31 12:36:33 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.22
DateTime Object ( [date] => 2014-12-31 14:01:16 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.21
DateTime Object ( [date] => 2014-12-31 15:33:16 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.20
DateTime Object ( [date] => 2014-12-31 16:31:48 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.19
DateTime Object ( [date] => 2014-12-31 17:49:29 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.18
DateTime Object ( [date] => 2014-12-31 18:50:18 [timezone_type] => 3 [timezone] => Europe/Amsterdam )