Commit f2c9e03e4ad for php

commit f2c9e03e4ad2add0052ea7860fb8216ede1d776f
Author: Daniel Scherzer <daniel.e.scherzer@gmail.com>
Date:   Sun Oct 4 19:33:11 2026 -0700

    [`%pS` migration] Use `%pS` in ext/uri (#23172)

diff --git a/ext/uri/php_uri.c b/ext/uri/php_uri.c
index bdf1201e425..f50022aec81 100644
--- a/ext/uri/php_uri.c
+++ b/ext/uri/php_uri.c
@@ -358,7 +358,7 @@ ZEND_ATTRIBUTE_NONNULL_ARGS(1, 2) PHPAPI void php_uri_instantiate_uri(
 	if (should_update_this_object) {
 		uri_object = Z_URI_OBJECT_P(ZEND_THIS);
 		if (uri_object->uri != NULL) {
-			zend_throw_error(NULL, "Cannot modify readonly object of class %s", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name));
+			zend_throw_error(NULL, "Cannot modify readonly object of class %pS", Z_OBJCE_P(ZEND_THIS)->name);
 			RETURN_THROWS();
 		}
 	} else {
@@ -478,7 +478,7 @@ PHP_METHOD(Uri_WhatWg_InvalidUrlException, __construct)
 		zend_update_property(php_uri_ce_whatwg_invalid_url_exception, Z_OBJ_P(ZEND_THIS), ZEND_STRL("errors"), &tmp);
 	} else {
 		if (!is_list_of_whatwg_validation_errors(Z_ARR_P(errors))) {
-			zend_argument_value_error(2, "must be a list of %s", ZSTR_VAL(php_uri_ce_whatwg_url_validation_error->name));
+			zend_argument_value_error(2, "must be a list of %pS", php_uri_ce_whatwg_url_validation_error->name);
 			RETURN_THROWS();
 		}

@@ -731,7 +731,7 @@ PHP_METHOD(Uri_Rfc3986_Uri, withFragment)

 static void throw_cannot_recompose_uri_to_string(php_uri_object *object)
 {
-	zend_throw_exception_ex(php_uri_ce_error, 0, "Cannot recompose %s to a string", ZSTR_VAL(object->std.ce->name));
+	zend_throw_exception_ex(php_uri_ce_error, 0, "Cannot recompose %pS to a string", object->std.ce->name);
 }

 static void uri_equals(INTERNAL_FUNCTION_PARAMETERS, php_uri_object *that_object, zend_enum_Uri_UriComparisonMode comparison_mode)
@@ -867,52 +867,52 @@ static void uri_unserialize(INTERNAL_FUNCTION_PARAMETERS)
 	php_uri_object *uri_object = php_uri_object_from_obj(Z_OBJ_P(ZEND_THIS));
 	if (uri_object->uri != NULL) {
 		/* Intentionally throw two exceptions for proper chaining. */
-		zend_throw_error(NULL, "Cannot modify readonly object of class %s", ZSTR_VAL(uri_object->std.ce->name));
-		zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object", ZSTR_VAL(uri_object->std.ce->name));
+		zend_throw_error(NULL, "Cannot modify readonly object of class %pS", uri_object->std.ce->name);
+		zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %pS object", uri_object->std.ce->name);
 		RETURN_THROWS();
 	}

 	/* Verify the expected number of elements, this implicitly ensures that no additional elements are present. */
 	if (zend_hash_num_elements(data) != 2) {
-		zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object", ZSTR_VAL(uri_object->std.ce->name));
+		zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %pS object", uri_object->std.ce->name);
 		RETURN_THROWS();
 	}

 	/* Unserialize state: "uri" key in the first array */
 	zval *arr = zend_hash_index_find(data, 0);
 	if (arr == NULL || Z_TYPE_P(arr) != IS_ARRAY) {
-		zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object", ZSTR_VAL(uri_object->std.ce->name));
+		zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %pS object", uri_object->std.ce->name);
 		RETURN_THROWS();
 	}

 	/* Verify the expected number of elements inside the first array, this implicitly ensures that no additional elements are present. */
 	if (zend_hash_num_elements(Z_ARRVAL_P(arr)) != 1) {
-		zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object", ZSTR_VAL(uri_object->std.ce->name));
+		zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %pS object", uri_object->std.ce->name);
 		RETURN_THROWS();
 	}

 	zval *uri_zv = zend_hash_str_find(Z_ARRVAL_P(arr), ZEND_STRL(PHP_URI_SERIALIZE_URI_FIELD_NAME));
 	if (uri_zv == NULL || Z_TYPE_P(uri_zv) != IS_STRING) {
-		zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object", ZSTR_VAL(uri_object->std.ce->name));
+		zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %pS object", uri_object->std.ce->name);
 		RETURN_THROWS();
 	}

 	uri_object->uri = uri_object->parser->parse(Z_STRVAL_P(uri_zv), Z_STRLEN_P(uri_zv), NULL, NULL, true);
 	if (uri_object->uri == NULL) {
-		zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object", ZSTR_VAL(uri_object->std.ce->name));
+		zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %pS object", uri_object->std.ce->name);
 		RETURN_THROWS();
 	}

 	/* Unserialize regular properties: second array */
 	arr = zend_hash_index_find(data, 1);
 	if (arr == NULL || Z_TYPE_P(arr) != IS_ARRAY) {
-		zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object", ZSTR_VAL(uri_object->std.ce->name));
+		zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %pS object", uri_object->std.ce->name);
 		RETURN_THROWS();
 	}

 	/* Verify that there is no regular property in the second array, because the URI classes have no properties and they are final. */
 	if (zend_hash_num_elements(Z_ARRVAL_P(arr)) > 0) {
-		zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object", ZSTR_VAL(uri_object->std.ce->name));
+		zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %pS object", uri_object->std.ce->name);
 		RETURN_THROWS();
 	}
 }
diff --git a/ext/uri/php_uri_common.c b/ext/uri/php_uri_common.c
index e4850d8059e..bee17986ca8 100644
--- a/ext/uri/php_uri_common.c
+++ b/ext/uri/php_uri_common.c
@@ -75,7 +75,7 @@ void php_uri_property_read_helper(INTERNAL_FUNCTION_PARAMETERS, php_uri_property
 	const php_uri_property_handler *property_handler = php_uri_parser_property_handler_by_name(uri_object->parser, property_name);

 	if (UNEXPECTED(property_handler->read(uri_object->uri, component_read_mode, return_value) == FAILURE)) {
-		zend_throw_exception_ex(php_uri_ce_error, 0, "The %s component cannot be retrieved", ZSTR_VAL(get_known_string_by_property_name(property_name)));
+		zend_throw_exception_ex(php_uri_ce_error, 0, "The %pS component cannot be retrieved", get_known_string_by_property_name(property_name));
 		RETURN_THROWS();
 	}
 }