3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function is_valid_date($date) { if (preg_match('/^((19|20)\\d\\d)-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01]) ([01]\d|2[0123]):([0-5]\d):([0-5]\d)$/', $date, $matches)){ return checkdate($matches[3], $matches[4], $matches[1]); } return false; } var_dump(is_valid_date("2012-12-02 15:30:00")); //true ?>
Output for 4.3.0 - 5.6.20, hhvm-3.9.1, hhvm-3.12.0, 7.0.0 - 7.0.5
bool(true)
Output for hhvm-3.11.0

Process exited with code 137.
Output for hhvm-3.10.0

Process exited with code 153.