3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = new \DateTime('-10 days'); echo $a->format('Y-m-d H:i:s');
based on QPf09
Output for 5.6.28, 7.0.20 - 7.2.0
2015-08-25 21:08:39
Output for 7.0.6
2016-04-23 06:56:24
Output for 7.0.5
2016-03-23 19:56:41
Output for 7.0.4
2016-02-29 06:05:14
Output for 7.0.3
2016-03-08 06:31:59
Output for 7.0.2
2016-03-12 12:04:51
Output for 7.0.1
2016-03-13 17:27:31
Output for 7.0.0
2016-03-16 19:09:42
Output for 5.6.21
2016-04-22 02:13:26
Output for 5.6.20
2016-03-30 15:14:55
Output for 5.6.19
2016-02-26 07:36:25
Output for 5.6.18
2016-03-04 20:10:15
Output for 5.6.17
2016-03-09 10:52:28
Output for 5.6.16
2016-03-17 20:54:34
Output for 5.6.15
2016-03-18 21:46:53
Output for 5.6.14
2016-03-23 00:15:32
Output for 5.6.13
2016-04-05 04:19:33
Output for 5.6.12
2016-04-09 17:51:13
Output for 5.6.11
2016-04-13 00:49:15
Output for 5.6.10
2016-04-15 02:40:39
Output for 5.6.9
2016-04-17 07:39:15
Output for 5.6.8
2016-04-19 15:33:02
Output for 5.6.7
2016-05-15 07:32:18
Output for 5.5.35
2016-05-12 05:51:07
Output for 5.5.34
2016-03-31 21:11:07
Output for 5.5.33
2016-02-27 16:58:52
Output for 5.5.32
2016-03-06 23:01:41
Output for 5.5.31
2016-03-10 13:41:11
Output for 5.5.30
2016-03-21 23:46:40
Output for 5.5.29
2016-04-06 18:24:49
Output for 5.5.28
2016-04-10 20:55:03
Output for 5.5.27
2016-04-11 23:21:52
Output for 5.5.26
2016-04-16 05:06:56
Output for 5.5.25
2016-04-18 11:09:14
Output for 5.5.24
2016-05-13 18:03:30
Output for 5.4.45
2015-08-27 15:31:58
Output for 5.4.42 - 5.4.44
2015-08-25 21:08:49
Output for 5.4.35 - 5.4.41
2015-08-25 21:08:50
Output for 5.4.27 - 5.4.34
2015-08-25 21:08:51
Output for 5.4.20 - 5.4.26
2015-08-25 21:08:52
Output for 5.4.11 - 5.4.19
2015-08-25 21:08:53
Output for 5.4.2 - 5.4.10
2015-08-25 21:08:54
Output for 5.3.26 - 5.4.1
2015-08-25 21:08:55
Output for 5.3.19 - 5.3.25
2015-08-25 21:08:56
Output for 5.3.12 - 5.3.18
2015-08-25 21:08:57
Output for 5.3.6 - 5.3.11
2015-08-25 21:08:58
Output for 5.3.0 - 5.3.5
2015-08-25 21:08:59
Output for 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/0dPpr on line 3 2015-08-25 21:08:59
Output for 5.2.10 - 5.2.16
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/0dPpr on line 3 2015-08-25 21:09:00
Output for 5.2.3 - 5.2.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/0dPpr on line 3 2015-08-25 21:09:01
Output for 5.2.0 - 5.2.2
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/0dPpr on line 3 2015-08-25 21:09:02
Output for 5.0.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/0dPpr on line 3 Fatal error: Class 'DateTime' not found in /in/0dPpr on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/0dPpr on line 3 Fatal error: Cannot instantiate non-existent class: datetime in /in/0dPpr on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/0dPpr on line 3 Fatal error: Cannot instantiate non-existent class: datetime in /in/0dPpr on line 3