3v4l.org

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