3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = '2011-02'; $d = DateTime::createFromFormat('Y-m', $date); $t = $d && $d->format('Y-m') == $date; var_dump($t);
based on s72eR
Output for 5.3.21 - 5.5.24, 5.5.26 - 5.5.35, 5.6.9 - 5.6.14, 5.6.16 - 7.2.0
bool(true)
Output for 5.5.25, 5.6.8, 5.6.15
bool(false)