3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $f = new \DateTime('previous month last day of last hour'); //$f->modify('first day of'); echo $f->format('Y-m-d H:i:s');
based on 3jCtq
Output for 5.6.28, 7.0.20 - 7.2.0
2015-11-30 08:03:08
Output for 7.0.6
2016-04-30 12:06:20
Output for 7.0.5
2016-03-31 08:10:09
Output for 7.0.4
2016-02-29 20:16:04
Output for 7.0.3
2016-02-29 21:38:03
Output for 7.0.2
2016-02-29 03:51:30
Output for 7.0.1
2016-02-29 07:00:17
Output for 7.0.0
2016-02-29 08:53:42
Output for 5.6.21
2016-04-30 15:02:28
Output for 5.6.20
2016-03-31 07:12:00
Output for 5.6.19
2016-02-29 04:23:35
Output for 5.6.18
2016-02-29 13:19:17
Output for 5.6.17
2016-02-29 00:51:38
Output for 5.6.16
2016-02-29 09:43:12
Output for 5.6.15
2016-02-29 10:32:14
Output for 5.6.14
2016-03-31 16:14:34
Output for 5.6.13
2016-03-31 16:53:32
Output for 5.6.12
2016-03-31 07:22:29
Output for 5.6.11
2016-03-31 13:48:12
Output for 5.6.10
2016-03-31 15:53:44
Output for 5.6.9
2016-03-31 21:11:03
Output for 5.6.8
2016-03-31 05:50:53
Output for 5.5.35
2016-04-30 00:37:58
Output for 5.5.34
2016-03-31 09:25:29
Output for 5.5.33
2016-02-29 07:22:36
Output for 5.5.32
2016-02-29 17:15:13
Output for 5.5.31
2016-02-29 04:00:02
Output for 5.5.30
2016-03-31 12:24:35
Output for 5.5.29
2016-03-31 07:11:22
Output for 5.5.28
2016-03-31 10:40:35
Output for 5.5.27
2016-03-31 12:20:01
Output for 5.5.26
2016-03-31 18:34:35
Output for 5.5.25
2016-03-31 01:58:32
Output for 5.5.24
2016-04-30 08:23:53
Output for 5.4.44 - 5.4.45
2015-11-30 08:03:12
Output for 5.4.41 - 5.4.43
2015-11-30 08:03:14
Output for 5.4.40
2015-11-30 08:03:15
Output for 5.4.38 - 5.4.39
2015-11-30 08:03:16
Output for 5.4.36 - 5.4.37
2015-11-30 08:03:17
Output for 5.4.34 - 5.4.35
2015-11-30 08:03:18
Output for 5.3.29, 5.4.29 - 5.4.32
2015-11-30 08:03:19
Output for 5.4.25 - 5.4.28
2015-11-30 08:03:20
Output for 5.3.28, 5.4.22 - 5.4.24
2015-11-30 08:03:21
Output for 5.4.19 - 5.4.21
2015-11-30 08:03:22
Output for 5.3.26 - 5.3.27, 5.4.16 - 5.4.18
2015-11-30 08:03:23
Output for 5.3.23 - 5.3.25, 5.4.12 - 5.4.15
2015-11-30 08:03:24
Output for 5.3.21 - 5.3.22, 5.4.11
2015-11-30 08:03:25