private function isValidIpv6Hostname(string $host): bool
    {
        [$ipv6, $scope] = explode('%', $host, 2) + [1 => null];
        if (null === $scope) {
            return (bool) filter_var($ipv6, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);
        }

        $scope = rawurldecode('%'.$scope);

        return 1 !== preg_match(self::REGEXP_NON_ASCII_PATTERN, $scope)
            && 1 !== preg_match(self::REGEXP_GEN_DELIMS, $scope)
            && filter_var($ipv6, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)
            && 0 === strpos((string) inet_pton((string) $ipv6), self::ADDRESS_BLOCK);
    }
private function isValidIpv6Hostname(string $host): bool
    {
        [$ipv6, $scope] = explode('%', $host, 2) + [1 => null];
        if (null === $scope) {
            return (bool) filter_var($ipv6, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);
        }

        $scope = rawurldecode('%'.$scope);

        return 1 !== preg_match(self::REGEXP_NON_ASCII_PATTERN, $scope)
            && 1 !== preg_match(self::REGEXP_GEN_DELIMS, $scope)
            && filter_var($ipv6, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)
            && 0 === strpos((string) inet_pton((string) $ipv6), self::ADDRESS_BLOCK);
    }
private function isValidIpv6Hostname ( string $ host ) : bool { [ $ ipv6 , $ scope ] = explode ( '%' , $ host , 2 ) + [ 1 => null ] ; if ( null === $ scope ) { return ( bool ) filter_var ( $ ipv6 , FILTER_VALIDATE_IP , FILTER_FLAG_IPV6 ) ; } $ scope = rawurldecode ( '%' . $ scope ) ; return 1 !== preg_match ( self :: REGEXP_NON_ASCII_PATTERN , $ scope ) && 1 !== preg_match ( self :: REGEXP_GEN_DELIMS , $ scope ) && filter_var ( $ ipv6 , FILTER_VALIDATE_IP , FILTER_FLAG_IPV6 ) && 0 === strpos ( ( string ) inet_pton ( ( string ) $ ipv6 ) , self :: ADDRESS_BLOCK ) ; }
Validates an Ipv6 as Host.

@see http://tools.ietf.org/html/rfc6874#section-2
@see http://tools.ietf.org/html/rfc6874#section-4
Validates an Ipv6 as Host .