public static function validIpv6($value)
    {
        if (empty($value)) {
            throw new \InvalidArgumentException("Empty IPv6 address given.");
        }

        if (!filter_var($value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
            throw new \InvalidArgumentException("Invalid IPv6 address given.");
        }

        return $value;
    }
public static function validIpv6($value)
    {
        if (empty($value)) {
            throw new \InvalidArgumentException("Empty IPv6 address given.");
        }

        if (!filter_var($value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
            throw new \InvalidArgumentException("Invalid IPv6 address given.");
        }

        return $value;
    }
public static function validIpv6 ( $ value ) { if ( empty ( $ value ) ) { throw new \ InvalidArgumentException ( "Empty IPv6 address given." ) ; } if ( ! filter_var ( $ value , FILTER_VALIDATE_IP , FILTER_FLAG_IPV6 ) ) { throw new \ InvalidArgumentException ( "Invalid IPv6 address given." ) ; } return $ value ; }
Validates the given value using the PHP filter_var with
FILTER_VALIDATE_IP and flag FILTER_FLAG_IPV6

@param string $value IP to validate

@return string ipv6 (may still be in private or reserved range)

@throws \InvalidArgumentException in case of validation errors (invalid or empty ip)
Validates the given value using the PHP filter_var with FILTER_VALIDATE_IP and flag FILTER_FLAG_IPV6