3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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('YY-MM-DD');
Output for 5.6.28, 7.0.14 - 7.1.0
20152015-MarMar-ThuThu
Output for 5.6.7, 7.0.6
20172017-MayMay-WedWed
Output for 5.5.24, 5.5.29, 5.6.20, 7.0.5
20172017-AprApr-SunSun
Output for 5.5.30, 7.0.4
20172017-MarMar-FriFri
Output for 7.0.3
20172017-MarMar-SatSat
Output for 5.6.15, 5.6.18 - 5.6.19, 7.0.2
20172017-MarMar-TueTue
Output for 5.5.32, hhvm-3.12.0, 7.0.1
20172017-MarMar-ThuThu
Output for 5.6.17, 7.0.0
20172017-MarMar-SunSun
Output for 5.5.33, hhvm-3.10.0
20172017-MarMar-WedWed
Output for 5.5.35, 5.6.21
20172017-MayMay-MonMon
Output for 5.5.31, 5.6.16
20172017-MarMar-MonMon
Output for 5.6.8, 5.6.11, 5.6.13 - 5.6.14
20172017-AprApr-SatSat
Output for 5.5.26, 5.6.12
20172017-AprApr-WedWed
Output for 5.5.34, 5.6.10
20172017-AprApr-MonMon
Output for 5.5.28, 5.6.9
20172017-AprApr-ThuThu
Output for 5.5.25, 5.5.27
20172017-AprApr-FriFri
Output for 5.2.0 - 5.4.45
20172017-FebFeb-SunSun
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/4T38t 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/4T38t on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_VARIABLE in /in/4T38t on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/4T38t on line 4
Process exited with code 255.