3v4l.org

run code in 300+ PHP versions simultaneously
<?php $today = new DateTime('now'); $today_string = $today->format('Y-m-d'); $next_year = clone $today; $next_year->modify( '+1 year' ); $next_year_string = $next_year->format('Y-m-d'); echo $next_year->format('y-m-d');
Output for 5.2.0 - 5.2.17, 5.3.0 - 5.3.28, 5.4.0 - 5.4.26, 7.0.14 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.12 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
15-03-19
Output for 7.0.6
17-05-03
Output for 7.0.5
17-04-03
Output for 7.0.4
17-03-10
Output for 7.0.3
17-03-18
Output for 7.0.2
17-03-22
Output for 7.0.1
17-03-24
Output for 7.0.0
17-03-27
Output for 5.6.21
17-05-02
Output for 5.6.20
17-04-10
Output for 5.6.19
17-03-08
Output for 5.6.18
17-03-15
Output for 5.6.17
17-03-19
Output for 5.6.16
17-03-28
Output for 5.6.15
17-03-29
Output for 5.6.14
17-04-02
Output for 5.6.13
17-04-15
Output for 5.6.12
17-04-20
Output for 5.6.11
17-04-23
Output for 5.6.10
17-04-25
Output for 5.6.9
17-04-27
Output for 5.6.8
17-04-30
Output for 5.5.35
17-05-22
Output for 5.5.34
17-04-11
Output for 5.5.33
17-03-09
Output for 5.5.32
17-03-17
Output for 5.5.31
17-03-21
Output for 5.5.30
17-04-01
Output for 5.5.29
17-04-17
Output for 5.5.28
17-04-21
Output for 5.5.27
17-04-22
Output for 5.5.26
17-04-26
Output for 5.5.25
17-04-28
Output for 5.5.24
17-05-24
Output for 5.4.45
16-09-09
Output for 5.4.44
16-08-27
Output for 5.4.43
16-07-11
Output for 5.4.42
16-06-29
Output for 5.4.38 - 5.4.41
16-06-10
Output for 5.4.34 - 5.4.37
16-02-08
Output for 5.3.29, 5.4.27 - 5.4.32
15-09-07
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/MDhqK on line 2
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_VARIABLE in /in/MDhqK on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
Parse error: parse error, unexpected T_VARIABLE in /in/MDhqK on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/MDhqK on line 4
Process exited with code 255.

preferences:
205.06 ms | 401 KiB | 309 Q