3v4l.org

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