Commit 6bfe63761f3 for php
commit 6bfe63761f3370b2d9337368537a5b969f27c300
Author: Daniel Scherzer <daniel.e.scherzer@gmail.com>
Date: Sat Aug 8 13:16:50 2026 -0700
[`%pS` migration] Use `%pS` in ext/standard/var_unserializer.re
diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re
index 992175155d2..5d0859ce1ed 100644
--- a/ext/standard/var_unserializer.re
+++ b/ext/standard/var_unserializer.re
@@ -579,8 +579,8 @@ static int is_property_visibility_changed(zend_class_entry *ce, zval *key)
return 1;
} else {
php_error_docref(NULL, E_WARNING,
- "Cannot unserialize value for virtual property %s::$%s",
- ZSTR_VAL(existing_propinfo->ce->name), Z_STRVAL_P(key));
+ "Cannot unserialize value for virtual property %pS::$%pS",
+ existing_propinfo->ce->name, Z_STR_P(key));
zval_ptr_dtor_str(key);
return -1;
}
@@ -677,13 +677,13 @@ declared_property:
if (EXPECTED(!ret)) {
if (UNEXPECTED(obj->ce->ce_flags & ZEND_ACC_NO_DYNAMIC_PROPERTIES)) {
- zend_throw_error(NULL, "Cannot create dynamic property %s::$%s",
- ZSTR_VAL(obj->ce->name), zend_get_unmangled_property_name(Z_STR_P(&key)));
+ zend_throw_error(NULL, "Cannot create dynamic property %pS::$%s",
+ obj->ce->name, zend_get_unmangled_property_name(Z_STR_P(&key)));
zval_ptr_dtor_str(&key);
goto failure;
} else if (!(obj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) {
- zend_error(E_DEPRECATED, "Creation of dynamic property %s::$%s is deprecated",
- ZSTR_VAL(obj->ce->name), zend_get_unmangled_property_name(Z_STR_P(&key)));
+ zend_error(E_DEPRECATED, "Creation of dynamic property %pS::$%s is deprecated",
+ obj->ce->name, zend_get_unmangled_property_name(Z_STR_P(&key)));
if (EG(exception)) {
zval_ptr_dtor_str(&key);
goto failure;
@@ -819,7 +819,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce, boo
object_init_ex(rval, ce);
zend_hash_str_update(Z_OBJPROP_P(rval), MAGIC_MEMBER_SERIALIZED, sizeof(MAGIC_MEMBER_SERIALIZED) - 1, &payload);
} else if (ce->unserialize == NULL) {
- zend_error(E_WARNING, "Class %s has no unserializer", ZSTR_VAL(ce->name));
+ zend_error(E_WARNING, "Class %pS has no unserializer", ce->name);
/* __PHP_Incomplete_Class has no internal state, an empty instance is safe. */
if (ce != PHP_IC_ENTRY) {
return 0;
@@ -1356,7 +1356,7 @@ object ":" uiv ":" ["] {
/* The callback function may have defined the class */
BG(serialize_lock)++;
if ((ce = zend_lookup_class(class_name)) == NULL) {
- php_error_docref(NULL, E_WARNING, "Function %s() hasn't defined the class it was called for", Z_STRVAL(user_func));
+ php_error_docref(NULL, E_WARNING, "Function %pS() hasn't defined the class it was called for", Z_STR(user_func));
incomplete_class = 1;
ce = PHP_IC_ENTRY;
}
@@ -1368,8 +1368,8 @@ object ":" uiv ":" ["] {
*p = YYCURSOR;
if (ce->ce_flags & ZEND_ACC_NOT_SERIALIZABLE) {
- zend_throw_exception_ex(NULL, 0, "Unserialization of '%s' is not allowed",
- ZSTR_VAL(ce->name));
+ zend_throw_exception_ex(NULL, 0, "Unserialization of '%pS' is not allowed",
+ ce->name);
zend_string_release_ex(class_name, 0);
return 0;
}
@@ -1419,7 +1419,7 @@ object ":" uiv ":" ["] {
* there is both Serializable::unserialize() and __unserialize(), then both may be used,
* depending on the serialization format. */
if (ce->serialize != NULL && !has_unserialize) {
- zend_error(E_WARNING, "Erroneous data format for unserializing '%s'", ZSTR_VAL(ce->name));
+ zend_error(E_WARNING, "Erroneous data format for unserializing '%pS'", ce->name);
zend_string_release_ex(class_name, 0);
return 0;
}
@@ -1501,11 +1501,11 @@ object ":" uiv ":" ["] {
zend_class_entry *ce = zend_lookup_class(enum_name);
BG(serialize_lock)--;
if (!ce) {
- php_error_docref(NULL, E_WARNING, "Class '%s' not found", ZSTR_VAL(enum_name));
+ php_error_docref(NULL, E_WARNING, "Class '%pS' not found", enum_name);
goto fail;
}
if (!(ce->ce_flags & ZEND_ACC_ENUM)) {
- php_error_docref(NULL, E_WARNING, "Class '%s' is not an enum", ZSTR_VAL(enum_name));
+ php_error_docref(NULL, E_WARNING, "Class '%pS' is not an enum", enum_name);
goto fail;
}
@@ -1514,12 +1514,12 @@ object ":" uiv ":" ["] {
zend_class_constant *c = zend_hash_find_ptr(CE_CONSTANTS_TABLE(ce), case_name);
if (!c) {
- php_error_docref(NULL, E_WARNING, "Undefined constant %s::%s", ZSTR_VAL(enum_name), ZSTR_VAL(case_name));
+ php_error_docref(NULL, E_WARNING, "Undefined constant %pS::%pS", enum_name, case_name);
goto fail;
}
if (!(ZEND_CLASS_CONST_FLAGS(c) & ZEND_CLASS_CONST_IS_CASE)) {
- php_error_docref(NULL, E_WARNING, "%s::%s is not an enum case", ZSTR_VAL(enum_name), ZSTR_VAL(case_name));
+ php_error_docref(NULL, E_WARNING, "%pS::%pS is not an enum case", enum_name, case_name);
goto fail;
}