3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $format="Y-m"; $date="2018-02"; $d = DateTime::createFromFormat($format, $date); echo ($d->format($format)); echo "\n" . date_format($d, $format);
based on 9AtQH
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.1.0 - 7.2.6
2018-03 2018-03