original_string: protected function checkValidEmail($email) {
      if (function_exists('mailparse_rfc822_parse_addresses')) {
        $parsed = mailparse_rfc822_parse_addresses($email);
        if (count($parsed) > 0 && array_key_exists('address', $parsed[0])) {
          $email = $parsed[0]['address'];
        } else {
          return false;
        }
      }
      return filter_var($email, FILTER_VALIDATE_EMAIL) !== false;
    }
code: protected function checkValidEmail($email) {
      if (function_exists('mailparse_rfc822_parse_addresses')) {
        $parsed = mailparse_rfc822_parse_addresses($email);
        if (count($parsed) > 0 && array_key_exists('address', $parsed[0])) {
          $email = $parsed[0]['address'];
        } else {
          return false;
        }
      }
      return filter_var($email, FILTER_VALIDATE_EMAIL) !== false;
    }
code_tokens: protected function checkValidEmail ( $ email ) { if ( function_exists ( 'mailparse_rfc822_parse_addresses' ) ) { $ parsed = mailparse_rfc822_parse_addresses ( $ email ) ; if ( count ( $ parsed ) > 0 && array_key_exists ( 'address' , $ parsed [ 0 ] ) ) { $ email = $ parsed [ 0 ] [ 'address' ] ; } else { return false ; } } return filter_var ( $ email , FILTER_VALIDATE_EMAIL ) !== false ; }
docstring: Checks that an email is valid using the mailparse extension if available.
  
  @param string $email The email to be validated.
  @return bool True if valid, false otherwise.
docstring_tokens: Checks that an email is valid using the mailparse extension if available .