Commit 4ff538c4ad6 for php.net
commit 4ff538c4ad62900f4286ee4b5268495bba3f82b5
Author: Tim Düsterhus <tim@tideways-gmbh.com>
Date: Tue Sep 22 17:11:45 2026 +0200
uri: Fix casing of `UriHostType` and `UrlHostType` enum cases (#23851)
According to naming policy and the RFC, these should be `IpV`, not `IPv`.
diff --git a/ext/uri/php_uri.stub.php b/ext/uri/php_uri.stub.php
index feca1871cea..856a960a732 100644
--- a/ext/uri/php_uri.stub.php
+++ b/ext/uri/php_uri.stub.php
@@ -39,9 +39,9 @@ enum UriType
enum UriHostType
{
- case IPv4;
- case IPv6;
- case IPvFuture;
+ case IpV4;
+ case IpV6;
+ case IpVFuture;
case RegisteredName;
}
@@ -204,8 +204,8 @@ public function __construct(string $context, \Uri\WhatWg\UrlValidationErrorType
enum UrlHostType
{
- case IPv4;
- case IPv6;
+ case IpV4;
+ case IpV6;
case Domain;
case Opaque;
case Empty;
diff --git a/ext/uri/php_uri_arginfo.h b/ext/uri/php_uri_arginfo.h
index 8139d4fbf7b..43535287d78 100644
Binary files a/ext/uri/php_uri_arginfo.h and b/ext/uri/php_uri_arginfo.h differ
diff --git a/ext/uri/php_uri_decl.h b/ext/uri/php_uri_decl.h
index 04d12097833..9423aff69fe 100644
Binary files a/ext/uri/php_uri_decl.h and b/ext/uri/php_uri_decl.h differ
diff --git a/ext/uri/tests/rfc3986/getters/host_type_success_ip_future.phpt b/ext/uri/tests/rfc3986/getters/host_type_success_ip_future.phpt
index c2edc849086..b06f2b28fd8 100644
--- a/ext/uri/tests/rfc3986/getters/host_type_success_ip_future.phpt
+++ b/ext/uri/tests/rfc3986/getters/host_type_success_ip_future.phpt
@@ -9,4 +9,4 @@
?>
--EXPECT--
-enum(Uri\Rfc3986\UriHostType::IPvFuture)
+enum(Uri\Rfc3986\UriHostType::IpVFuture)
diff --git a/ext/uri/tests/rfc3986/getters/host_type_success_ipv4.phpt b/ext/uri/tests/rfc3986/getters/host_type_success_ipv4.phpt
index 1c0c4448b95..639e5981f6f 100644
--- a/ext/uri/tests/rfc3986/getters/host_type_success_ipv4.phpt
+++ b/ext/uri/tests/rfc3986/getters/host_type_success_ipv4.phpt
@@ -9,4 +9,4 @@
?>
--EXPECT--
-enum(Uri\Rfc3986\UriHostType::IPv4)
+enum(Uri\Rfc3986\UriHostType::IpV4)
diff --git a/ext/uri/tests/rfc3986/getters/host_type_success_ipv6.phpt b/ext/uri/tests/rfc3986/getters/host_type_success_ipv6.phpt
index 5f3d826b412..89dc2b8e72b 100644
--- a/ext/uri/tests/rfc3986/getters/host_type_success_ipv6.phpt
+++ b/ext/uri/tests/rfc3986/getters/host_type_success_ipv6.phpt
@@ -9,4 +9,4 @@
?>
--EXPECT--
-enum(Uri\Rfc3986\UriHostType::IPv6)
+enum(Uri\Rfc3986\UriHostType::IpV6)
diff --git a/ext/uri/tests/whatwg/getters/host_type_success_ipv4.phpt b/ext/uri/tests/whatwg/getters/host_type_success_ipv4.phpt
index f2f63caabb5..207b63a054d 100644
--- a/ext/uri/tests/whatwg/getters/host_type_success_ipv4.phpt
+++ b/ext/uri/tests/whatwg/getters/host_type_success_ipv4.phpt
@@ -9,4 +9,4 @@
?>
--EXPECT--
-enum(Uri\WhatWg\UrlHostType::IPv4)
+enum(Uri\WhatWg\UrlHostType::IpV4)
diff --git a/ext/uri/tests/whatwg/getters/host_type_success_ipv6.phpt b/ext/uri/tests/whatwg/getters/host_type_success_ipv6.phpt
index ce5bb00b93d..200c968cde5 100644
--- a/ext/uri/tests/whatwg/getters/host_type_success_ipv6.phpt
+++ b/ext/uri/tests/whatwg/getters/host_type_success_ipv6.phpt
@@ -9,4 +9,4 @@
?>
--EXPECT--
-enum(Uri\WhatWg\UrlHostType::IPv6)
+enum(Uri\WhatWg\UrlHostType::IpV6)
diff --git a/ext/uri/uri_parser_rfc3986.c b/ext/uri/uri_parser_rfc3986.c
index 20bac3b1426..48fcb236e8b 100644
--- a/ext/uri/uri_parser_rfc3986.c
+++ b/ext/uri/uri_parser_rfc3986.c
@@ -293,11 +293,11 @@ ZEND_ATTRIBUTE_NONNULL void php_uri_parser_rfc3986_host_type_read(php_uri_parser
zend_object *value;
if (uriparser_uri->hostData.ip4 != NULL) {
- value = zend_enum_get_case_by_id(php_uri_ce_rfc3986_uri_host_type, ZEND_ENUM_Uri_Rfc3986_UriHostType_IPv4);
+ value = zend_enum_get_case_by_id(php_uri_ce_rfc3986_uri_host_type, ZEND_ENUM_Uri_Rfc3986_UriHostType_IpV4);
} else if (uriparser_uri->hostData.ip6 != NULL) {
- value = zend_enum_get_case_by_id(php_uri_ce_rfc3986_uri_host_type, ZEND_ENUM_Uri_Rfc3986_UriHostType_IPv6);
+ value = zend_enum_get_case_by_id(php_uri_ce_rfc3986_uri_host_type, ZEND_ENUM_Uri_Rfc3986_UriHostType_IpV6);
} else if (has_text_range(&uriparser_uri->hostData.ipFuture)) {
- value = zend_enum_get_case_by_id(php_uri_ce_rfc3986_uri_host_type, ZEND_ENUM_Uri_Rfc3986_UriHostType_IPvFuture);
+ value = zend_enum_get_case_by_id(php_uri_ce_rfc3986_uri_host_type, ZEND_ENUM_Uri_Rfc3986_UriHostType_IpVFuture);
} else {
value = zend_enum_get_case_by_id(php_uri_ce_rfc3986_uri_host_type, ZEND_ENUM_Uri_Rfc3986_UriHostType_RegisteredName);
}
diff --git a/ext/uri/uri_parser_whatwg.c b/ext/uri/uri_parser_whatwg.c
index 1a258c6c940..3e1e587da75 100644
--- a/ext/uri/uri_parser_whatwg.c
+++ b/ext/uri/uri_parser_whatwg.c
@@ -392,10 +392,10 @@ ZEND_ATTRIBUTE_NONNULL void php_uri_parser_whatwg_host_type_read(const lxb_url_t
{
switch (lexbor_uri->host.type) {
case LXB_URL_HOST_TYPE_IPV4:
- ZVAL_OBJ_COPY(retval, zend_enum_get_case_cstr(php_uri_ce_whatwg_url_host_type, "IPv4"));
+ ZVAL_OBJ_COPY(retval, zend_enum_get_case_cstr(php_uri_ce_whatwg_url_host_type, "IpV4"));
return;
case LXB_URL_HOST_TYPE_IPV6:
- ZVAL_OBJ_COPY(retval, zend_enum_get_case_cstr(php_uri_ce_whatwg_url_host_type, "IPv6"));
+ ZVAL_OBJ_COPY(retval, zend_enum_get_case_cstr(php_uri_ce_whatwg_url_host_type, "IpV6"));
return;
case LXB_URL_HOST_TYPE_DOMAIN:
ZVAL_OBJ_COPY(retval, zend_enum_get_case_cstr(php_uri_ce_whatwg_url_host_type, "Domain"));