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('F',strtotime($months[$i])); if ($result != $months[$i]) { $correct = "yes"; } else { $correct = "no"; $yes++; } echo $correct . " - " . $result . "\n"; } echo "\n" . $yes . " / 12 correct months."; ?>
Output for 5.2.0 - 5.6.23, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
no - January yes - March no - March yes - May no - May yes - July no - July no - August yes - October no - October yes - December no - December 7 / 12 correct months.
Output for 4.3.0 - 5.1.6
no - January yes - January yes - January yes - January yes - January yes - January yes - January yes - January yes - January yes - January yes - January yes - January 1 / 12 correct months.