3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $months = array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); $yes = 0; for ($i = 0; $i < 12; ++$i) { $result = date('m.d.y', strtotime($months[$i])); if ((substr($result, 0, 2)-1) != $i) { $correct = "no"; } else { $correct = "yes"; $yes++; } echo $correct . " - " . $result . "\n"; } echo "\n" . $yes . " / 12 correct months."; ?>
Output for 5.2.0 - 7.1.0
yes - 01.31.13 no - 03.03.13 yes - 03.31.13 no - 05.01.13 yes - 05.31.13 no - 07.01.13 yes - 07.31.13 yes - 08.31.13 no - 10.01.13 yes - 10.31.13 no - 12.01.13 yes - 12.31.13 7 / 12 correct months.
Output for 4.3.0 - 5.1.6
yes - 01.01.70 no - 01.01.70 no - 01.01.70 no - 01.01.70 no - 01.01.70 no - 01.01.70 no - 01.01.70 no - 01.01.70 no - 01.01.70 no - 01.01.70 no - 01.01.70 no - 01.01.70 1 / 12 correct months.