3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $lastMonth = new Datetime('-1 month'); print_r($lastMonth);
based on AK2XI
Output for 7.2.0
DateTime Object ( [date] => 2015-11-02 22:08:42.024643 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.1.10
DateTime Object ( [date] => 2015-11-02 22:08:42.099885 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.1.7
DateTime Object ( [date] => 2015-11-02 22:08:42.003658 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.1.6
DateTime Object ( [date] => 2015-11-02 22:08:42.013070 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.1.5
DateTime Object ( [date] => 2015-11-02 22:08:42.005537 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.1.0
DateTime Object ( [date] => 2015-11-02 22:08:42.004004 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.28, 7.0.20
DateTime Object ( [date] => 2015-11-02 22:08:42.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.6
DateTime Object ( [date] => 2016-04-03 19:57:02.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.5
DateTime Object ( [date] => 2016-03-03 08:16:32.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.4
DateTime Object ( [date] => 2016-02-10 20:11:27.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.3
DateTime Object ( [date] => 2016-02-18 21:33:03.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.2
DateTime Object ( [date] => 2016-02-23 03:47:05.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.1
DateTime Object ( [date] => 2016-02-24 07:03:13.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.0
DateTime Object ( [date] => 2016-02-27 08:57:32.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.21
DateTime Object ( [date] => 2016-04-02 15:05:36.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.20
DateTime Object ( [date] => 2016-03-10 07:17:54.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.19
DateTime Object ( [date] => 2016-02-08 04:24:27.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.18
DateTime Object ( [date] => 2016-02-15 13:15:08.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.17
DateTime Object ( [date] => 2016-02-20 00:49:32.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.16
DateTime Object ( [date] => 2016-02-28 09:46:36.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.15
DateTime Object ( [date] => 2016-02-29 10:36:02.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.14
DateTime Object ( [date] => 2016-03-14 16:17:09.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.13
DateTime Object ( [date] => 2016-03-15 16:57:33.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.12
DateTime Object ( [date] => 2016-03-20 07:24:35.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.11
DateTime Object ( [date] => 2016-03-24 13:49:26.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.10
DateTime Object ( [date] => 2016-03-25 15:53:10.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.9
DateTime Object ( [date] => 2016-03-27 21:01:38.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.8
DateTime Object ( [date] => 2016-03-30 05:52:11.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.35
DateTime Object ( [date] => 2016-04-23 00:05:45.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.34
DateTime Object ( [date] => 2016-03-11 09:29:15.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.33
DateTime Object ( [date] => 2016-02-09 07:17:19.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.32
DateTime Object ( [date] => 2016-02-17 17:07:51.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.31
DateTime Object ( [date] => 2016-02-21 03:55:12.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.30
DateTime Object ( [date] => 2016-03-01 12:28:58.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.29
DateTime Object ( [date] => 2016-03-17 07:15:36.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.28
DateTime Object ( [date] => 2016-03-21 10:40:23.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.27
DateTime Object ( [date] => 2016-03-22 12:23:15.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.26
DateTime Object ( [date] => 2016-03-26 18:33:49.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.25
DateTime Object ( [date] => 2016-03-29 01:57:23.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.24
DateTime Object ( [date] => 2016-04-24 08:08:25.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.45
DateTime Object ( [date] => 2015-11-02 22:08:45.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.44
DateTime Object ( [date] => 2015-11-02 22:08:46.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.43
DateTime Object ( [date] => 2015-11-02 22:08:47.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.41 - 5.4.42
DateTime Object ( [date] => 2015-11-02 22:08:48.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.39 - 5.4.40
DateTime Object ( [date] => 2015-11-02 22:08:49.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.36 - 5.4.38
DateTime Object ( [date] => 2015-11-02 22:08:50.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.34 - 5.4.35
DateTime Object ( [date] => 2015-11-02 22:08:51.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.31 - 5.4.32
DateTime Object ( [date] => 2015-11-02 22:08:52.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.30
DateTime Object ( [date] => 2015-11-02 22:08:53.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.26 - 5.4.29
DateTime Object ( [date] => 2015-11-02 22:08:53 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.4.23 - 5.4.25
DateTime Object ( [date] => 2015-11-02 22:08:54 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.28, 5.4.20 - 5.4.22
DateTime Object ( [date] => 2015-11-02 22:08:55 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.27, 5.4.17 - 5.4.19
DateTime Object ( [date] => 2015-11-02 22:08:56 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.25 - 5.3.26, 5.4.14 - 5.4.16
DateTime Object ( [date] => 2015-11-02 22:08:57 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.21 - 5.3.24, 5.4.12 - 5.4.13
DateTime Object ( [date] => 2015-11-02 22:08:58 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.20, 5.4.10 - 5.4.11
DateTime Object ( [date] => 2015-11-02 22:08:59 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.3.29
DateTime Object ( [date] => 2015-11-02 22:08:52 [timezone_type] => 3 [timezone] => Europe/Amsterdam )