code: public static function isBirthDate($date)
      {
          if ($date === null || $date === '0000-00-00') {
              return true;
          }
          if (preg_match('/^(\d{4})-((?:0?[1-9])|(?:1[0-2]))-((?:0?[1-9])|(?:[1-2]\d)|(?:3[01]))(\d{2}:\d{2}:\d{2})?$/', $date, $birth_date)) {
              return !(($birth_date[1] > date('Y') && $birth_date[2] > date('m') && $birth_date[3] > date('d')) ||
                  ($birth_date[1] === date('Y') && $birth_date[2] === date('m') && $birth_date[3] > date('d')) ||
                  ($birth_date[1] === date('Y') && $birth_date[2] > date('m'))
              );
          }
  
          return false;
      }
docs: Check for birthDate validity
  
  @param string $date birthdate to validate
  
  @return boolean Validity is ok or not