protected function getPort($default = 3000)
    {
        $ports = [];
        foreach ($this->getServerInfo() as $address => $server) {
            $ports[] = $server['port'];
        }

        return PortUtil::getPort($ports ? max($ports) + 1 : $default);
    }
protected function getPort($default = 3000)
    {
        $ports = [];
        foreach ($this->getServerInfo() as $address => $server) {
            $ports[] = $server['port'];
        }

        return PortUtil::getPort($ports ? max($ports) + 1 : $default);
    }
protected function getPort ( $ default = 3000 ) { $ ports = [ ] ; foreach ( $ this -> getServerInfo ( ) as $ address => $ server ) { $ ports [ ] = $ server [ 'port' ] ; } return PortUtil :: getPort ( $ ports ? max ( $ ports ) + 1 : $ default ) ; }
Automatically determine the best port for a new server.

@param int $default

@return int
Automatically determine the best port for a new server .