3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new \DateTime('500 years ago'); echo $date->format('Y-m-d H:i:s');
Output for 5.6.28, 7.0.14 - 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.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
1514-10-13 12:54:26
Output for 7.3.32 - 7.3.33, 8.0.13
1514-10-13 10:54:26
Output for 7.0.6
1516-05-03 10:24:24
Output for 7.0.5
1516-04-02 23:10:28
Output for 7.0.4
1516-03-10 09:46:54
Output for 7.0.3
1516-03-18 10:26:43
Output for 7.0.2
1516-03-22 16:25:14
Output for 7.0.1
1516-03-23 21:00:35
Output for 7.0.0
1516-03-26 22:32:58
Output for 5.6.21
1516-05-02 05:43:52
Output for 5.6.20
1516-04-09 22:10:00
Output for 5.6.19
1516-03-07 17:54:08
Output for 5.6.18
1516-03-15 02:00:19
Output for 5.6.17
1516-03-19 14:40:19
Output for 5.6.16
1516-03-28 00:30:02
Output for 5.6.15
1516-03-29 01:25:23
Output for 5.6.14
1516-04-02 03:44:24
Output for 5.6.13
1516-04-15 07:38:43
Output for 5.6.12
1516-04-19 21:27:14
Output for 5.6.11
1516-04-23 04:29:10
Output for 5.6.10
1516-04-25 06:13:59
Output for 5.6.9
1516-04-27 11:13:07
Output for 5.6.8
1516-04-29 19:21:27
Output for 5.5.35
1516-05-22 09:31:35
Output for 5.5.34
1516-04-11 00:29:24
Output for 5.5.33
1516-03-08 20:51:06
Output for 5.5.32
1516-03-17 03:34:09
Output for 5.5.31
1516-03-20 17:25:35
Output for 5.5.30
1516-04-01 03:22:05
Output for 5.5.29
1516-04-16 21:45:56
Output for 5.5.28
1516-04-21 00:43:10
Output for 5.5.27
1516-04-22 03:00:46
Output for 5.5.26
1516-04-26 08:40:33
Output for 5.5.25
1516-04-28 14:59:04
Output for 5.5.24
1516-05-23 22:19:07
Output for 5.4.45
1515-09-21 14:52:22
Output for 5.4.44
1515-08-17 08:13:44
Output for 5.4.43
1515-08-17 08:13:39
Output for 5.4.42
1515-07-09 06:16:48
Output for 5.4.41
1515-07-09 06:16:47
Output for 5.4.39 - 5.4.40
1515-07-09 06:16:42
Output for 5.4.38
1515-07-09 06:16:40
Output for 5.4.35 - 5.4.37
1515-07-09 06:16:38
Output for 5.4.34
1515-07-09 06:16:37
Output for 5.4.30 - 5.4.32
1514-10-13 12:54:30
Output for 5.4.9 - 5.4.29
1514-10-13 12:54:31
Output for 5.3.20 - 5.3.29, 5.4.0 - 5.4.8
1514-10-13 12:54:32
Output for 5.3.0 - 5.3.19
1514-10-13 12:54:33
Output for 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/S4lY2 on line 2 1514-10-13 12:54:33
Output for 5.2.0 - 5.2.16
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/S4lY2 on line 2 1514-10-13 12:54:34
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/S4lY2 on line 2 Fatal error: Class 'DateTime' not found in /in/S4lY2 on line 2
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/S4lY2 on line 2 Fatal error: Cannot instantiate non-existent class: datetime in /in/S4lY2 on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/S4lY2 on line 2 Fatal error: Cannot instantiate non-existent class: datetime in /in/S4lY2 on line 2

preferences:
227.25 ms | 401 KiB | 338 Q