original_string: public function isPreferred()
      {
          if (($host = $this->export()) === null) {
              return $this->base === $this->effective;
          }
          $parsed = parse_url($host);
          $new = [
              'scheme' => isset($parsed['scheme']) ? $parsed['scheme'] : parse_url($this->base, PHP_URL_SCHEME),
              'host' => isset($parsed['host']) ? $parsed['host'] : $parsed['path'],
          ];
          $new['port'] = isset($parsed['port']) ? $parsed['port'] : getservbyname($new['scheme'], 'tcp');
          return $this->base == $new['scheme'] . '://' . $new['host'] . ':' . $new['port'];
      }
code: public function isPreferred()
      {
          if (($host = $this->export()) === null) {
              return $this->base === $this->effective;
          }
          $parsed = parse_url($host);
          $new = [
              'scheme' => isset($parsed['scheme']) ? $parsed['scheme'] : parse_url($this->base, PHP_URL_SCHEME),
              'host' => isset($parsed['host']) ? $parsed['host'] : $parsed['path'],
          ];
          $new['port'] = isset($parsed['port']) ? $parsed['port'] : getservbyname($new['scheme'], 'tcp');
          return $this->base == $new['scheme'] . '://' . $new['host'] . ':' . $new['port'];
      }
code_tokens: public function isPreferred ( ) { if ( ( $ host = $ this -> export ( ) ) === null ) { return $ this -> base === $ this -> effective ; } $ parsed = parse_url ( $ host ) ; $ new = [ 'scheme' => isset ( $ parsed [ 'scheme' ] ) ? $ parsed [ 'scheme' ] : parse_url ( $ this -> base , PHP_URL_SCHEME ) , 'host' => isset ( $ parsed [ 'host' ] ) ? $ parsed [ 'host' ] : $ parsed [ 'path' ] , ] ; $ new [ 'port' ] = isset ( $ parsed [ 'port' ] ) ? $ parsed [ 'port' ] : getservbyname ( $ new [ 'scheme' ] , 'tcp' ) ; return $ this -> base == $ new [ 'scheme' ] . '://' . $ new [ 'host' ] . ':' . $ new [ 'port' ] ; }
docstring: Is preferred host?
  
  @return bool
docstring_tokens: Is preferred host?