returns port of the uri

@param   int  $defaultPort  parameter is ignored for http uris
@return  int
344973
public function port(int $defaultPort = null): int
    {

        if ($this->isHttp()) {
            return parent::port(Http::PORT);
        }

        return parent::port(Http::PORT_SSL);
    }
270617
public function getPort() : int
   {

      if ( null !== $this->port )
      {
         return $this->port;
      }

      if ( null === $this->scheme )
      {
         $this->scheme = static::$fallbackScheme;
      }

      switch ( \strtolower( $this->scheme ) )
      {
         case UrlScheme::HTTP : return 80;
         case UrlScheme::SSL  : return 443;
         case UrlScheme::FTP  : return 21;
         default              : return 0;
      }

   }
508365
public function getPort($port_num)
    {
        $ports = $this->server->ports;
        foreach ($ports as $port) {
            if ($port->port == $port_num) {
                return $port;
            }
        }

        return null;
    }
481190
public function getPort()
    {
        if ($this->_port === null) {
            $this->_port = !$this->getIsSecureConnection() && isset($this->swooleRequest->server['SERVER_PORT']) ? (int) $this->swooleRequest->server['SERVER_PORT'] : 80;
        }

        return $this->_port;
    }
512171
public static function port(HTTPRequest $request = null)
    {
        $host = static::host($request);
        return (int)parse_url($host, PHP_URL_PORT) ?: null;
    }
625983
public Integer getPort(int defaultPort)
	{
		String port = getParameterValue(PORT);

		try
		{
			if (port != null)
			{
				return Integer.parseInt(port);
			}
		}
		catch (Exception ex)
		{

		}
		
		return defaultPort;
	}
481765
private int getPort(URI endpoint) {
        if (endpoint.getPort() != -1) {
            return endpoint.getPort();
        } else if ("https".equals(endpoint.getScheme())) {
            return 443;
        } else {
            return 80;
        }
    }
189689
public function setDefaultHost($host, $port = null) {
		$this->defaultHost = (string) $host;
		
		if ($port !== null) {
			$this->setDefaultPort($port);
		}
		
		return $this;
	}
960680
public function getPort()
    {
        return $this->port === null || $this->isDefaultPort($this->scheme, $this->port) ? null : $this->port;
    }
355806
private String getPort() {
        String url = getUrl();
        int i = url.indexOf("://") + 3;
        int j = url.indexOf("/", i);
        String s = i == 2 || j == -1 ? "" : url.substring(i, j);
        i = s.indexOf(":");
        return i == -1 ? "" : s.substring(i + 1);
    }
126040
private function filterPort(?int $port): ?int
    {
        if ($port === null) {
            return null;
        }

        $port = (int) $port;
        if (1 > $port || 0xffff < $port) {
            throw new \InvalidArgumentException(sprintf('Invalid port: %d. Must be between 1 and 65535', $port));
        }

        return
            !isset(self::$schemes[$this->scheme]) ||
            $port !== self::$schemes[$this->scheme]
                ? $port : null;
    }
926640
public final function withPort($port): UriInterface
   {
       if (!is_int($port)
        || !($parsedPort = $this->parsePort($port))) {
           throw new InvalidArgumentException(
               "Can't get with port: invalid port range");
       }
       return $this->with("port", $parsedPort);
   }
219531
protected function getDefaultPort()
    {
	    $driver = $this->mysql->driver;
	    $key    = $driver . '.default_port';
	    $port   = ini_get($key);

	    if ($port) {
	    	return $port;
	    }

	    return ini_get('mysqli.default_port');
    }
1026683
public function withPort(int $port): UriInterface
    {
        $instance = clone $this;
        $instance->port = $this->marshalPort($port);

        return $instance;
    }
629021
public static function filterPort(?int $port, string $scheme = ''): ?int
    {
        if (null === $port) {
            return null;
        }

        $port = (int) $port;

        if (self::MIN_PORT > $port || self::MAX_PORT < $port) {
            throw new \InvalidArgumentException(
                sprintf('Invalid port: %d. Must be between %d and %d', $port, self::MIN_PORT, self::MAX_PORT)
            );
        }

        if (DefaultPortIdentifier::isDefaultPort($scheme, $port)) {
            $port = null;
        }

        return $port;
    }
249389
function getPort(url) {
    // URL may contain the port number after the second colon.
    // http://domain:1234/
    var index = url.indexOf(":", 6); // skipping 6 characters to ignore first colon
    return index < 0 ? 80 : parseInt(url.substr(index + 1), 10);
  }
962611
public static function getPortFromURL($url)
	{
		$url = self::getDomainFromURL($url);
		$url = explode(':', $url);
		
		if(count($url) == 1)
		{
			return 80;
		}
		else
		{
			if(!is_numeric($url[1]))
				return 80;
			else
				return (integer) $url[1];
		}
	}