3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime('now'); echo $date->format('yy "-" MM "-" DD');
based on nggI3
Output for 5.2.0 - 5.4.45, 5.6.28, 7.0.20 - 7.2.0
1515 "-" SepSep "-" TueTue
Output for 7.0.6
1616 "-" MayMay "-" TueTue
Output for 5.5.29, 5.6.20, 7.0.5
1616 "-" AprApr "-" SatSat
Output for 5.5.30, 7.0.4
1616 "-" MarMar "-" ThuThu
Output for 7.0.3
1616 "-" MarMar "-" FriFri
Output for 5.6.15, 5.6.18 - 5.6.19, 7.0.2
1616 "-" MarMar "-" MonMon
Output for 5.5.32, 7.0.1
1616 "-" MarMar "-" WedWed
Output for 5.6.17, 7.0.0
1616 "-" MarMar "-" SatSat
Output for 5.5.24, 5.6.21
1616 "-" MayMay "-" MonMon
Output for 5.5.31, 5.6.16
1616 "-" MarMar "-" SunSun
Output for 5.6.8, 5.6.11, 5.6.13 - 5.6.14
1616 "-" AprApr "-" FriFri
Output for 5.5.26, 5.6.12
1616 "-" AprApr "-" TueTue
Output for 5.6.10
1616 "-" AprApr "-" MonMon
Output for 5.5.28, 5.6.9
1616 "-" AprApr "-" WedWed
Output for 5.6.7
1616 "-" MayMay "-" WedWed
Output for 5.5.35
1616 "-" MayMay "-" SunSun
Output for 5.5.34
1616 "-" AprApr "-" SunSun
Output for 5.5.33
1616 "-" MarMar "-" TueTue
Output for 5.5.25, 5.5.27
1616 "-" AprApr "-" ThuThu
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/Z4SFm on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/Z4SFm on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/Z4SFm on line 3