3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result=FALSE; $date =""; $pattern = '/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/'; preg_match($pattern, $date, $matches); if (is_array($matches) AND count($matches) >=1) { print "Valid Date"; }else{ print "Not Valid Date"; }

preferences:
35.51 ms | 402 KiB | 5 Q