private static function marshalHostAndPortFromHeader(stdClass $accumulator, $host)
{
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];
}
}