3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $oDatetime = new Datetime('last week'); echo $oDatetime->format('Y-m-d H:i:s');
based on rsAqs
Output for 5.6.28, 7.0.14 - 7.1.0
2014-10-06 04:28:25
Output for 7.0.7
2014-10-13 06:28:25
Output for 7.0.6
2016-04-25 23:25:05
Output for 7.0.5
2016-03-21 12:59:07
Output for 7.0.4
2016-02-29 21:48:44
Output for 7.0.3
2016-03-07 22:13:08
Output for 7.0.2
2016-03-14 08:58:05
Output for 7.0.1
2016-03-14 08:36:24
Output for 7.0.0
2016-03-14 11:49:24
Output for 5.6.21
2016-04-25 18:30:01
Output for 5.6.20
2016-03-28 08:18:17
Output for 5.6.19
2016-02-29 18:46:30
Output for 5.6.18
2016-03-07 07:13:05
Output for 5.6.17
2016-03-07 02:46:53
Output for 5.6.16
2016-03-21 13:31:45
Output for 5.6.15
2016-03-21 14:21:58
Output for 5.6.14
2016-03-21 17:15:41
Output for 5.6.13
2016-04-04 21:12:17
Output for 5.6.12
2016-04-11 10:11:40
Output for 5.6.11
2016-04-11 17:33:01
Output for 5.6.10
2016-04-18 19:10:21
Output for 5.6.9
2016-04-18 00:06:45
Output for 5.6.8
2016-04-18 07:45:51
Output for 5.6.7
2016-05-16 17:16:34
Output for 5.5.35
2016-05-09 21:36:40
Output for 5.5.34
2016-04-04 13:42:27
Output for 5.5.33
2016-02-29 08:56:40
Output for 5.5.32
2016-03-07 18:02:00
Output for 5.5.31
2016-03-14 05:44:20
Output for 5.5.30
2016-03-21 16:34:48
Output for 5.5.29
2016-04-04 11:08:46
Output for 5.5.28
2016-04-11 13:15:01
Output for 5.5.27
2016-04-11 16:02:53
Output for 5.5.26
2016-04-18 21:23:07
Output for 5.5.25
2016-04-18 03:27:16
Output for 5.5.24
2016-04-18 11:13:04
Output for 5.4.45
2015-09-14 15:37:15
Output for 5.4.44
2015-09-14 15:37:11
Output for 5.4.43
2015-09-14 15:37:06
Output for 5.4.42
2015-06-29 10:58:23
Output for 5.4.41
2015-06-29 10:58:21
Output for 5.4.40
2015-06-29 10:58:17
Output for 5.4.39
2015-06-29 10:58:16
Output for 5.4.38
2015-06-29 10:58:15
Output for 5.4.35 - 5.4.37
2015-06-29 10:58:12
Output for 5.4.24 - 5.4.34
2014-10-13 04:28:29
Output for 5.4.2 - 5.4.23
2014-10-13 04:28:30
Output for 5.3.11 - 5.4.1
2014-10-13 04:28:31
Output for 5.3.0 - 5.3.10
2014-10-13 04:28:32
Output for 5.2.5 - 5.2.17
2014-10-12 04:28:32
Output for 5.2.0 - 5.2.4
2014-10-12 04:28:33
Output for 5.0.0 - 5.1.6
Fatal error: Class 'Datetime' not found in /in/vmnAW on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/vmnAW on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/vmnAW on line 3