3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $f = new \DateTime('previous month'); $f->modify('first day of'); echo $f->format('Y-m-d H:i:s');
Output for 5.6.28, 7.0.20 - 7.2.0
2015-11-01 09:01:21
Output for 7.0.6
2016-04-01 13:06:18
Output for 7.0.5
2016-03-01 09:10:07
Output for 7.0.4
2016-02-01 21:16:03
Output for 7.0.3
2016-02-01 22:38:01
Output for 7.0.2
2016-02-01 04:51:28
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:27
Output for 5.6.20
2016-03-01 08:11:59
Output for 5.6.19
2016-02-01 05:23:33
Output for 5.6.18
2016-02-01 14:19:15
Output for 5.6.17
2016-02-01 01:51:36
Output for 5.6.16
2016-02-01 10:43:10
Output for 5.6.15
2016-02-01 11:32:12
Output for 5.6.14
2016-03-01 17:14:33
Output for 5.6.13
2016-03-01 17:53:30
Output for 5.6.12
2016-03-01 08:22:27
Output for 5.6.11
2016-03-01 14:48:11
Output for 5.6.10
2016-03-01 16:53:42
Output for 5.6.9
2016-03-01 22:11:02
Output for 5.6.8
2016-03-01 06:50:51
Output for 5.5.35
2016-04-01 01:37:56
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:11
Output for 5.5.31
2016-02-01 05:00:00
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:33
Output for 5.5.27
2016-03-01 13:19:59
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:51
Output for 5.4.45
2015-11-01 09:01:24
Output for 5.4.44
2015-11-01 09:01:25
Output for 5.4.41 - 5.4.43
2015-11-01 09:01:27
Output for 5.4.40
2015-11-01 09:01:28
Output for 5.4.38 - 5.4.39
2015-11-01 09:01:29
Output for 5.4.35 - 5.4.37
2015-11-01 09:01:30
Output for 5.4.34
2015-11-01 09:01:31
Output for 5.3.29, 5.4.30 - 5.4.32
2015-11-01 09:01:32
Output for 5.4.26 - 5.4.29
2015-11-01 09:01:33
Output for 5.3.28, 5.4.23 - 5.4.25
2015-11-01 09:01:34
Output for 5.4.19 - 5.4.22
2015-11-01 09:01:35
Output for 5.3.26 - 5.3.27, 5.4.17 - 5.4.18
2015-11-01 09:01:36
Output for 5.3.23 - 5.3.25, 5.4.12 - 5.4.16
2015-11-01 09:01:37
Output for 5.3.21 - 5.3.22, 5.4.11
2015-11-01 09:01:38