3v4l.org - online PHP & HHVM shell, execute code in 100+ different versions!

<?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.3, php7@20140507 - 20141101, hhvm-3.0.1 - 3.4.0
bool(true)