3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fix_strtotime($date) { if(preg_match('/([012]?[0-9]?:[0-5]{1}\d\s*[aA|pP]?[mM]?)(\s+)(.+)/', $date, $matches)) { return strtotime($matches[3] . $matches[2] . $matches[1]); } return strtotime($date); } echo fix_strtotime('04:00 yesterday'); // 2010-09-17 14:00:00

preferences:
54.42 ms | 402 KiB | 5 Q