[php-src] master: [`%pS` migration] Use `%pS` in Zend/zend_closures.c
| From: | Daniel Scherzer | Date: | Fri, 30 Oct 2026 01:10:36 +0000 |
| Subject: | [php-src] master: [`%pS` migration] Use `%pS` in Zend/zend_closures.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-142978@lists.php.net to get a copy of this message | ||
Author: Daniel Scherzer (DanielEScherzer)
Date: 2026-10-29T17:58:18-07:00
Commit: https://github.com/php/php-src/commit/35c796e90c31f708878b31bfcbc0d4ee5255b0e2
Raw diff: https://github.com/php/php-src/commit/35c796e90c31f708878b31bfcbc0d4ee5255b0e2.diff
[
%pS migration] Use %pS in Zend/zend_closures.c
Changed paths:
M Zend/zend_closures.c
Diff:
diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c
index d4c0b5881369..828c66b021ed 100644
--- a/Zend/zend_closures.c
+++ b/Zend/zend_closures.c
@@ -106,10 +106,10 @@ static bool zend_valid_closure_binding(
if (is_fake_closure && func->common.scope &&
!instanceof_function(new_this->ce, func->common.scope)) {
/* Binding incompatible $this to an internal method is not supported. */
- zend_error(E_WARNING, "Cannot bind method %s::%s() to object of class %s, this will be an
error in PHP 9",
- ZSTR_VAL(func->common.scope->name),
- ZSTR_VAL(func->common.function_name),
- ZSTR_VAL(new_this->ce->name));
+ zend_error(E_WARNING, "Cannot bind method %pS::%pS() to object of class %pS, this will be
an error in PHP 9",
+ func->common.scope->name,
+ func->common.function_name,
+ new_this->ce->name);
return false;
}
} else if (is_fake_closure && func->common.scope
@@ -124,8 +124,8 @@ static bool zend_valid_closure_binding(
if (scope && scope != func->common.scope && scope->type ==
ZEND_INTERNAL_CLASS) {
/* rebinding to internal class is not allowed */
- zend_error(E_WARNING, "Cannot bind closure to scope of internal class %s, this will be an
error in PHP 9",
- ZSTR_VAL(scope->name));
+ zend_error(E_WARNING, "Cannot bind closure to scope of internal class %pS, this will be an
error in PHP 9",
+ scope->name);
return false;
}
@@ -255,7 +255,7 @@ static zend_result do_closure_bind(zval *return_value, zval *zclosure, zend_obje
if (zend_string_equals(scope_str, ZSTR_KNOWN(ZEND_STR_STATIC))) {
ce = closure->func.common.scope;
} else if ((ce = zend_lookup_class(scope_str)) == NULL) {
- zend_error(E_WARNING, "Class \"%s\" not found", ZSTR_VAL(scope_str));
+ zend_error(E_WARNING, "Class \"%pS\" not found", scope_str);
RETVAL_NULL();
return FAILURE;
}
@@ -731,9 +731,9 @@ static HashTable *zend_closure_get_debug_info(zend_object *object, int *is_temp)
zend_string *name;
zval info;
ZEND_ASSERT(arg_info->name && "Argument should have name");
- name = zend_strpprintf(0, "%s$%s",
+ name = zend_strpprintf(0, "%s$%pS",
ZEND_ARG_SEND_MODE(arg_info) ? "&" : "",
- ZSTR_VAL(arg_info->name));
+ arg_info->name);
ZVAL_NEW_STR(&info, zend_strpprintf(0, "%s", i >= required ?
"<optional>" : "<required>"));
zend_hash_update(Z_ARRVAL(val), name, &info);
zend_string_release_ex(name, 0);