I used this condition to check if a user enters a valid date or not. When testing, I can enter this date [2020-99-99] and it will pass with no errors.
This throws an error in the
file C:\Program Files\JetBrains\PhpStorm 2019.3.4\plugins\php\lib\php.jar!\stubs\date\date_c.php
source root: date_c.php
switch ($option->option_en) {
case 'date':
if (\DateTime::createFromFormat('Y-m-d', $dataTypeValue) !== FALSE) {
return true;
}
$this->message = "You should enter valid " . $option->option_en;
break;
defaut:
return false;
break;
}```