From a7752740e582841039f36328fb50b32f95d08e00 Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Sat, 8 Aug 2026 16:28:26 -0700 Subject: [PATCH 1/8] [`%pS` migration] Use `%pS` in ext/dom/parentnode/tree.c --- ext/dom/parentnode/tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/dom/parentnode/tree.c b/ext/dom/parentnode/tree.c index 13a99023781f..aacc991cc735 100644 --- a/ext/dom/parentnode/tree.c +++ b/ext/dom/parentnode/tree.c @@ -465,7 +465,7 @@ static zend_result dom_sanity_check_node_list_types(zval *nodes, uint32_t nodesc const zend_class_entry *ce = Z_OBJCE(nodes[i]); if (!instanceof_function(ce, node_ce)) { - zend_argument_type_error(i + 1, "must be of type %s|string, %s given", ZSTR_VAL(node_ce->name), zend_zval_type_name(&nodes[i])); + zend_argument_type_error(i + 1, "must be of type %pS|string, %s given", node_ce->name, zend_zval_type_name(&nodes[i])); return FAILURE; } } else if (type == IS_STRING) { @@ -474,7 +474,7 @@ static zend_result dom_sanity_check_node_list_types(zval *nodes, uint32_t nodesc return FAILURE; } } else { - zend_argument_type_error(i + 1, "must be of type %s|string, %s given", ZSTR_VAL(node_ce->name), zend_zval_type_name(&nodes[i])); + zend_argument_type_error(i + 1, "must be of type %pS|string, %s given", node_ce->name, zend_zval_type_name(&nodes[i])); return FAILURE; } } From 68782175f1f6d90e1db99006fabd6ea7264a72b4 Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Sat, 8 Aug 2026 16:28:55 -0700 Subject: [PATCH 2/8] [`%pS` migration] Use `%pS` in ext/dom/document.c --- ext/dom/document.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/dom/document.c b/ext/dom/document.c index bad0dd9feb1b..0ec461cdd61e 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -2312,7 +2312,7 @@ static void dom_document_register_node_class(INTERNAL_FUNCTION_PARAMETERS, bool return; } - zend_argument_error(NULL, 2, "must be a class name derived from %s or null, %s given", ZSTR_VAL(basece->name), ZSTR_VAL(ce->name)); + zend_argument_error(NULL, 2, "must be a class name derived from %pS or null, %pS given", basece->name, ce->name); RETURN_THROWS(); } From 0663ad4d8c98481f80b2a7ee39592372820fea06 Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Sat, 8 Aug 2026 16:29:18 -0700 Subject: [PATCH 3/8] [`%pS` migration] Use `%pS` in ext/dom/html_collection.c --- ext/dom/html_collection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/dom/html_collection.c b/ext/dom/html_collection.c index 2aed253ab8d3..509d55a3e0b1 100644 --- a/ext/dom/html_collection.c +++ b/ext/dom/html_collection.c @@ -101,7 +101,7 @@ PHP_METHOD(Dom_HTMLCollection, namedItem) zval *dom_html_collection_read_dimension(zend_object *object, zval *offset, int type, zval *rv) { if (UNEXPECTED(!offset)) { - zend_throw_error(NULL, "Cannot append to %s", ZSTR_VAL(object->ce->name)); + zend_throw_error(NULL, "Cannot append to %pS", object->ce->name); return NULL; } From 23ff7dc75bcb730949a5014c5476533b4dadd243 Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Sat, 8 Aug 2026 16:30:26 -0700 Subject: [PATCH 4/8] [`%pS` migration] Use `%pS` in ext/dom/node.c --- ext/dom/node.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/dom/node.c b/ext/dom/node.c index e0af66227014..6892d60279a4 100644 --- a/ext/dom/node.c +++ b/ext/dom/node.c @@ -2652,14 +2652,14 @@ PHP_METHOD(Dom_Node, compareDocumentPosition) PHP_METHOD(Dom_Node, __construct) { - zend_throw_error(NULL, "Cannot directly construct %s, use document methods instead", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name)); + zend_throw_error(NULL, "Cannot directly construct %pS, use document methods instead", Z_OBJCE_P(ZEND_THIS)->name); } PHP_METHOD(DOMNode, __sleep) { ZEND_PARSE_PARAMETERS_NONE(); - zend_throw_exception_ex(NULL, 0, "Serialization of '%s' is not allowed, unless serialization methods are implemented in a subclass", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name)); + zend_throw_exception_ex(NULL, 0, "Serialization of '%pS' is not allowed, unless serialization methods are implemented in a subclass", Z_OBJCE_P(ZEND_THIS)->name); RETURN_THROWS(); } @@ -2667,7 +2667,7 @@ PHP_METHOD(DOMNode, __wakeup) { ZEND_PARSE_PARAMETERS_NONE(); - zend_throw_exception_ex(NULL, 0, "Unserialization of '%s' is not allowed, unless unserialization methods are implemented in a subclass", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name)); + zend_throw_exception_ex(NULL, 0, "Unserialization of '%pS' is not allowed, unless unserialization methods are implemented in a subclass", Z_OBJCE_P(ZEND_THIS)->name); RETURN_THROWS(); } From 74ac1bffb59caeb65d8c1c04021c0233b583f9c5 Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Sat, 8 Aug 2026 16:30:40 -0700 Subject: [PATCH 5/8] [`%pS` migration] Use `%pS` in ext/dom/nodelist.c --- ext/dom/nodelist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/dom/nodelist.c b/ext/dom/nodelist.c index 197ff3ceb880..d311c2c110e2 100644 --- a/ext/dom/nodelist.c +++ b/ext/dom/nodelist.c @@ -116,7 +116,7 @@ dom_nodelist_dimension_index dom_modern_nodelist_get_index(const zval *offset) zval *dom_modern_nodelist_read_dimension(zend_object *object, zval *offset, int type, zval *rv) { if (UNEXPECTED(!offset)) { - zend_throw_error(NULL, "Cannot append to %s", ZSTR_VAL(object->ce->name)); + zend_throw_error(NULL, "Cannot append to %pS", object->ce->name); return NULL; } From c6347e72329a0dae06a1ece6c617e84523f26ce9 Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Sat, 8 Aug 2026 16:31:20 -0700 Subject: [PATCH 6/8] [`%pS` migration] Use `%pS` in ext/dom/php_dom.c --- ext/dom/php_dom.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index 467271943275..27bea166cd22 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -484,7 +484,7 @@ static void dom_unset_property(zend_object *object, zend_string *member, void ** dom_object *obj = php_dom_obj_from_obj(object); if (obj->prop_handler != NULL && zend_hash_exists(obj->prop_handler, member)) { - zend_throw_error(NULL, "Cannot unset %s::$%s", ZSTR_VAL(object->ce->name), ZSTR_VAL(member)); + zend_throw_error(NULL, "Cannot unset %pS::$%pS", object->ce->name, member); return; } @@ -2308,7 +2308,7 @@ static bool dom_nodemap_or_nodelist_process_offset_as_named(zval *offset, zend_l static zval *dom_nodelist_read_dimension(zend_object *object, zval *offset, int type, zval *rv) { if (UNEXPECTED(!offset)) { - zend_throw_error(NULL, "Cannot access %s without offset", ZSTR_VAL(object->ce->name)); + zend_throw_error(NULL, "Cannot access %pS without offset", object->ce->name); return NULL; } @@ -2400,7 +2400,7 @@ void php_dom_get_content_into_zval(const xmlNode *nodep, zval *return_value, boo static zval *dom_nodemap_read_dimension(zend_object *object, zval *offset, int type, zval *rv) { if (UNEXPECTED(!offset)) { - zend_throw_error(NULL, "Cannot access %s without offset", ZSTR_VAL(object->ce->name)); + zend_throw_error(NULL, "Cannot access %pS without offset", object->ce->name); return NULL; } @@ -2444,7 +2444,7 @@ static int dom_nodemap_has_dimension(zend_object *object, zval *member, int chec static zval *dom_modern_nodemap_read_dimension(zend_object *object, zval *offset, int type, zval *rv) { if (UNEXPECTED(!offset)) { - zend_throw_error(NULL, "Cannot append to %s", ZSTR_VAL(object->ce->name)); + zend_throw_error(NULL, "Cannot append to %pS", object->ce->name); return NULL; } From 7e22c507670ed4e1200e41b120c9e3184c2d2cf5 Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Sat, 8 Aug 2026 16:31:37 -0700 Subject: [PATCH 7/8] [`%pS` migration] Use `%pS` in ext/dom/php_dom.h --- ext/dom/php_dom.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h index 6f4b5075b659..5c0b6a865f73 100644 --- a/ext/dom/php_dom.h +++ b/ext/dom/php_dom.h @@ -206,7 +206,7 @@ xmlNodePtr dom_nodelist_iter_start_first_child(xmlNodePtr nodep); #define DOM_GET_INTERN(__id, __intern) { \ __intern = Z_DOMOBJ_P(__id); \ if (UNEXPECTED(__intern->ptr == NULL)) { \ - zend_throw_error(NULL, "Couldn't fetch %s", ZSTR_VAL(__intern->std.ce->name));\ + zend_throw_error(NULL, "Couldn't fetch %pS", __intern->std.ce->name);\ RETURN_THROWS();\ } \ } From 3436707dd42f51319a3827da0dfc8ac20bab9400 Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Sat, 8 Aug 2026 16:32:01 -0700 Subject: [PATCH 8/8] [`%pS` migration] Use `%pS` in ext/dom/xml_common.h --- ext/dom/xml_common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/dom/xml_common.h b/ext/dom/xml_common.h index ec45fcc08342..2c16b3efc41e 100644 --- a/ext/dom/xml_common.h +++ b/ext/dom/xml_common.h @@ -55,8 +55,8 @@ PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj); #define NODE_GET_OBJ(__ptr, __id, __prtype, __intern) { \ __intern = Z_LIBXML_NODE_P(__id); \ if (UNEXPECTED(__intern->node == NULL)) { \ - php_error_docref(NULL, E_WARNING, "Couldn't fetch %s", \ - ZSTR_VAL(Z_OBJCE_P(__zv)->name));\ + php_error_docref(NULL, E_WARNING, "Couldn't fetch %pS", \ + Z_OBJCE_P(__zv)->name);\ RETURN_NULL();\ } \ __ptr = (__prtype)__intern->node->node; \