大网数据广告活动
PHP 语言与运行手册

The Uri\WhatWg\UrlValidationErrorType enum

· 52CE 我爱测

The possible validation errors defined in the » WHATWG URL Standard.

The Uri\WhatWg\UrlValidationErrorType enum

(PHP 8 >= 8.5.0)

Introduction

The possible validation errors defined in the » WHATWG URL Standard.

Enum synopsis

namespace Uri\WhatWg;
enum UrlValidationErrorType
{
case DomainToAscii ; //Error during the process of converting the domain name to an ASCII string.

case DomainToUnicode ; //Error during the process of converting the domain name to a Unicode string.

case DomainInvalidCodePoint ; //The input's host contains a forbidden domain code point.

case HostInvalidCodePoint ; //An opaque host (in a URL that is not special) contains a forbidden host code point.

case Ipv4EmptyPart ; //An IPv4 address ends with a U+002E (.).

case Ipv4TooManyParts ; //An IPv4 address does not consist of exactly 4 parts.

case Ipv4NonNumericPart ; //An IPv4 address part is not numeric.

case Ipv4NonDecimalPart ; //The IPv4 address contains numbers expressed using hexadecimal or octal digits.

case Ipv4OutOfRangePart ; //An IPv4 address part exceeds 255.

case Ipv6Unclosed ; //An IPv6 address is missing the closing U+005D (]).

case Ipv6InvalidCompression ; //An IPv6 address begins with improper compression.

case Ipv6TooManyPieces ; //An IPv6 address contains more than 8 pieces.

case Ipv6MultipleCompression ; //An IPv6 address is compressed in more than one spot.

case Ipv6InvalidCodePoint ; // An IPv6 address contains a code point that is neither an ASCII hex digit nor a U+003A (:). Or it unexpectedly ends.

case Ipv6TooFewPieces ; //An uncompressed IPv6 address contains fewer than 8 pieces.

case Ipv4InIpv6TooManyPieces ; //An IPv6 address with IPv4 address syntax: the IPv6 address has more than 6 pieces.

case Ipv4InIpv6InvalidCodePoint ; //An IPv6 address with IPv4 address syntax: an IPv4 part is empty, contains a non-ASCII digit or a leading zero, or there are too many IPv4 parts.

case Ipv4InIpv6OutOfRangePart ; //An IPv6 address with IPv4 address syntax: an IPv4 part exceeds 255.

case Ipv4InIpv6TooFewParts ; //An IPv6 address with IPv4 address syntax: an IPv4 address contains too few parts.

case InvalidUrlUnit ; //A code point is found that is not a URL unit.

case SpecialSchemeMissingFollowingSolidus ; //The input’s scheme is not followed by //.

case MissingSchemeNonRelativeUrl ; // The input is missing a scheme, because it does not begin with an ASCII alpha, and either no base URL was provided or the base URL cannot be used as a base URL because it has an opaque path.

case InvalidReverseSoldius ; //The URL has a special scheme and it uses U+005C (\) instead of U+002F (/).

case InvalidCredentials ; //The input includes credentials.

case HostMissing ; //The input has a special scheme, but does not contain a host.

case PortOutOfRange ; //The input’s port is too big.

case PortInvalid ; //The input’s port is invalid.

case FileInvalidWindowsDriveLetter ; // The input is a relative-URL string that starts with a Windows drive letter and the base URL's scheme is file.

case FileInvalidWindowsDriveLetterHost ; //A file: URL's host is a Windows drive letter.

}

来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
PHP Documentation Group
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。