public static function validatePort($port)
    {
        if (!is_numeric($port) || $port <= 1023 || $port > 65535) {
            return false;
        }

        return !in_array($port, self::$unsafePorts);
    }
public static function validatePort($port)
    {
        if (!is_numeric($port) || $port <= 1023 || $port > 65535) {
            return false;
        }

        return !in_array($port, self::$unsafePorts);
    }
public static function validatePort ( $ port ) { if ( ! is_numeric ( $ port ) || $ port <= 1023 || $ port > 65535 ) { return false ; } return ! in_array ( $ port , self :: $ unsafePorts ) ; }
Validate a port number.

@param int|string $port

@return bool
Validate a port number .