private static function marshalIpv6HostAndPort(stdClass $accumulator, array $server)
{
$accumulator->host = '[' . $server['SERVER_ADDR'] . ']';
$accumulator->port = $accumulator->port ?: 80;
if ($accumulator->port . ']' == substr($accumulator->host, strrpos($accumulator->host, ':') + 1)) {
// The last digit of the IPv6-Address has been taken as port
// Unset the port so the default port can be used
$accumulator->port = null;
}
}