private static function marshalHostAndPortFromHeader(stdClass $accumulator, $host): void
    {
        if (\is_array($host)) {
            $host = implode(', ', $host);
        }

        $accumulator->host = $host;
        $accumulator->port = null;

        // Works for regname, IPv4 & IPv6
        if (preg_match('|\:(\d+)$|', $accumulator->host, $matches)) {
            $accumulator->host = substr($accumulator->host, 0, -1 * (\strlen($matches[1]) + 1));
            $accumulator->port = (int) $matches[1];
        }
    }