3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $dates = array( // MM DD YYYY '11/12/2013' => strtotime('2013-11-12'), // Using 0 goes to the previous month '0/12/2013' => strtotime('2012-12-12'), // 31st of November (30 days) goes to 1st December '11/31/2013' => strtotime('2013-12-01'), // There isn't a 25th month... expect false '25/12/2013' => false, // DD MM YYYY '11-12-2013' => strtotime('2013-12-11'), '11.12.2013' => strtotime('2013-12-11'), '31.12.2013' => strtotime('2013-12-31'), // There isn't a 25th month expect false '12.25.2013' => false, ); foreach($dates as $date => $expected) { var_dump(strtotime($date) == $expected); }
Output for 5.1.3 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) bool(true)
Output for 5.1.0 - 5.1.2
bool(true) bool(true) bool(true) bool(true) bool(false) bool(true) bool(true) bool(true)
Output for 4.3.0 - 5.0.5
bool(true) bool(true) bool(true) bool(false) bool(false) bool(false) bool(false) bool(false)