From e9afe3406a043026aa868753a95a9f05bcb044ed 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 06c5e8b3134f0eaaf6ffd15ba7119f4836bcc569 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 605c4dae782b..ccb2c08bc815 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -2315,7 +2315,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 67509a863615a2989fb417843191a4a670cd2422 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 6310aef54bc2..89dbf9f2765f 100644 --- a/ext/dom/html_collection.c +++ b/ext/dom/html_collection.c @@ -100,7 +100,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 ff05c67e2ca58973f1e4150ec0bb1171ac388a7d 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 a3d40a92bfb7..a562328cd26e 100644 --- a/ext/dom/node.c +++ b/ext/dom/node.c @@ -2691,14 +2691,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(); } @@ -2706,7 +2706,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 1c921ff04a86a8e6cd1624332f73717c2ad03b00 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 a78d5a604563327234eb54a7392adb77aad5c32e 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 845507924c1e..4e55b04ac0d4 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -482,7 +482,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; } @@ -2307,7 +2307,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; } @@ -2399,7 +2399,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; } @@ -2443,7 +2443,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 b7f1b60a99e7ebea261d8ca755d5dad031eef45c 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 445081203afe..a45fdb0aa59e 100644 --- a/ext/dom/php_dom.h +++ b/ext/dom/php_dom.h @@ -207,7 +207,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 8661547102c7f23cd38b2b640308583596528ff6 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; \