3v4l.org

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