3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new \DateTime('-2 days'); echo $a->format('Y-m-d H:i:s');
Output for 5.6.28, 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
2015-09-02 21:08:01
Output for 7.3.32 - 7.3.33, 8.0.13
2015-09-02 19:08:01
Output for 7.0.6
2016-05-01 06:56:27
Output for 7.0.5
2016-03-31 19:56:45
Output for 7.0.4
2016-03-08 06:05:14
Output for 7.0.3
2016-03-16 06:31:58
Output for 7.0.2
2016-03-20 12:04:51
Output for 7.0.1
2016-03-21 17:27:30
Output for 7.0.0
2016-03-24 19:09:41
Output for 5.6.21
2016-04-30 02:13:29
Output for 5.6.20
2016-04-07 15:14:59
Output for 5.6.19
2016-03-05 07:36:24
Output for 5.6.18
2016-03-12 20:10:14
Output for 5.6.17
2016-03-17 10:52:27
Output for 5.6.16
2016-03-25 20:54:33
Output for 5.6.15
2016-03-26 21:46:50
Output for 5.6.14
2016-03-31 00:15:36
Output for 5.6.13
2016-04-13 04:19:37
Output for 5.6.12
2016-04-17 17:51:17
Output for 5.6.11
2016-04-21 00:49:18
Output for 5.6.10
2016-04-23 02:40:43
Output for 5.6.9
2016-04-25 07:39:27
Output for 5.6.8
2016-04-27 15:33:05
Output for 5.6.7
2016-05-23 07:32:26
Output for 5.5.35
2016-05-20 05:51:09
Output for 5.5.34
2016-04-08 21:11:10
Output for 5.5.33
2016-03-06 16:58:52
Output for 5.5.32
2016-03-14 23:01:40
Output for 5.5.31
2016-03-18 13:41:10
Output for 5.5.30
2016-03-29 23:46:44
Output for 5.5.29
2016-04-14 18:24:53
Output for 5.5.28
2016-04-18 20:55:17
Output for 5.5.27
2016-04-19 23:21:56
Output for 5.5.26
2016-04-24 05:07:00
Output for 5.5.25
2016-04-26 11:09:17
Output for 5.5.24
2016-05-21 18:03:33
Output for 5.4.45
2015-09-04 15:31:48
Output for 5.4.44
2015-09-02 21:08:11
Output for 5.4.38 - 5.4.43
2015-09-02 21:08:12
Output for 5.4.32 - 5.4.37
2015-09-02 21:08:13
Output for 5.4.27 - 5.4.31
2015-09-02 21:08:14
Output for 5.4.23 - 5.4.26
2015-09-02 21:08:15
Output for 5.4.18 - 5.4.22
2015-09-02 21:08:16
Output for 5.4.13 - 5.4.17
2015-09-02 21:08:17
Output for 5.4.8 - 5.4.12
2015-09-02 21:08:18
Output for 5.4.4 - 5.4.7
2015-09-02 21:08:19
Output for 5.4.0 - 5.4.3
2015-09-02 21:08:20
Output for 5.3.24 - 5.3.29
2015-09-02 21:08:21
Output for 5.3.20 - 5.3.23
2015-09-02 21:08:22
Output for 5.3.15 - 5.3.19
2015-09-02 21:08:23
Output for 5.3.10 - 5.3.14
2015-09-02 21:08:24
Output for 5.3.5 - 5.3.9
2015-09-02 21:08:25
Output for 5.3.0 - 5.3.4
2015-09-02 21:08:26
Output for 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QPf09 on line 3 2015-09-02 21:08:26
Output for 5.2.11 - 5.2.16
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QPf09 on line 3 2015-09-02 21:08:27
Output for 5.2.4 - 5.2.10
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QPf09 on line 3 2015-09-02 21:08:28
Output for 5.2.0 - 5.2.3
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QPf09 on line 3 2015-09-02 21:08:29
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QPf09 on line 3 Fatal error: Class 'DateTime' not found in /in/QPf09 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QPf09 on line 3 Fatal error: Cannot instantiate non-existent class: datetime in /in/QPf09 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/QPf09 on line 3 Fatal error: Cannot instantiate non-existent class: datetime in /in/QPf09 on line 3

preferences:
251.27 ms | 402 KiB | 342 Q