[php-src] master: Merge branch 'PHP-8.6'
| From: | Daniel Scherzer | Date: | Sat, 24 Oct 2026 03:35:09 +0000 |
| Subject: | [php-src] master: Merge branch 'PHP-8.6' | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-142657@lists.php.net to get a copy of this message | ||
Author: Daniel Scherzer (DanielEScherzer)
Date: 2026-10-23T20:34:02-07:00
Commit: https://github.com/php/php-src/commit/4a51e519d7199bd80be1660b167179386c76aa48
Raw diff: https://github.com/php/php-src/commit/4a51e519d7199bd80be1660b167179386c76aa48.diff
Merge branch 'PHP-8.6'
* PHP-8.6:
[
%pS migration] Use %pS in ext/spl/spl_observer.c
[%pS migration] Use %pS in ext/spl/spl_iterators.c
[%pS migration] Use %pS in ext/spl/spl_heap.c
[%pS migration] Use %pS in ext/spl/spl_directory.c
[%pS migration] Use %pS in ext/spl/spl_array.c
[%pS migration] Use %pS in ext/spl/php_spl.c
Changed paths:
M ext/spl/php_spl.c
M ext/spl/spl_array.c
M ext/spl/spl_directory.c
M ext/spl/spl_heap.c
M ext/spl/spl_iterators.c
M ext/spl/spl_observer.c
Diff:
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c
index 0c5f1ba99c19..a3b0bfbe770e 100644
--- a/ext/spl/php_spl.c
+++ b/ext/spl/php_spl.c
@@ -42,7 +42,7 @@ static zend_class_entry * spl_find_ce_by_name(zend_string *name, bool autoload)
{
zend_class_entry *ce = zend_lookup_class_ex(name, NULL, autoload ? 0 :
ZEND_FETCH_CLASS_NO_AUTOLOAD);
if (ce == NULL) {
- php_error_docref(NULL, E_WARNING, "Class %s does not exist%s", ZSTR_VAL(name), autoload
? " and could not be loaded" : "");
+ php_error_docref(NULL, E_WARNING, "Class %pS does not exist%s", name, autoload ? "
and could not be loaded" : "");
return NULL;
}
@@ -502,7 +502,7 @@ static void spl_build_class_list_string(zval *entry, char **list) /* {{{ */
{
char *res;
- spprintf(&res, 0, "%s, %s", *list, Z_STRVAL_P(entry));
+ spprintf(&res, 0, "%s, %pS", *list, Z_STR_P(entry));
efree(*list);
*list = res;
} /* }}} */
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 5b05e660931c..9ca034e72abb 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -346,14 +346,14 @@ static zval *spl_array_get_dimension_ptr(bool check_inherited,
spl_array_object
if (Z_TYPE_P(retval) == IS_UNDEF) {
switch (type) {
case BP_VAR_R:
- zend_error(E_WARNING, "Undefined array key \"%s\"", ZSTR_VAL(key.key));
+ zend_error(E_WARNING, "Undefined array key \"%pS\"", key.key);
ZEND_FALLTHROUGH;
case BP_VAR_UNSET:
case BP_VAR_IS:
retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
- zend_error(E_WARNING,"Undefined array key \"%s\"", ZSTR_VAL(key.key));
+ zend_error(E_WARNING,"Undefined array key \"%pS\"", key.key);
ZEND_FALLTHROUGH;
case BP_VAR_W: {
ZVAL_NULL(retval);
@@ -364,14 +364,14 @@ static zval *spl_array_get_dimension_ptr(bool check_inherited,
spl_array_object
} else {
switch (type) {
case BP_VAR_R:
- zend_error(E_WARNING, "Undefined array key \"%s\"", ZSTR_VAL(key.key));
+ zend_error(E_WARNING, "Undefined array key \"%pS\"", key.key);
ZEND_FALLTHROUGH;
case BP_VAR_UNSET:
case BP_VAR_IS:
retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
- zend_error(E_WARNING,"Undefined array key \"%s\"", ZSTR_VAL(key.key));
+ zend_error(E_WARNING,"Undefined array key \"%pS\"", key.key);
ZEND_FALLTHROUGH;
case BP_VAR_W: {
zval value;
@@ -678,7 +678,7 @@ void spl_array_iterator_append(zval *object, zval *append_value) /* {{{ */
spl_array_object *intern = Z_SPLARRAY_P(object);
if (spl_array_is_object(intern)) {
- zend_throw_error(NULL, "Cannot append properties to objects, use %s::offsetSet()
instead", ZSTR_VAL(Z_OBJCE_P(object)->name));
+ zend_throw_error(NULL, "Cannot append properties to objects, use %pS::offsetSet()
instead", Z_OBJCE_P(object)->name);
return;
}
@@ -960,15 +960,15 @@ static void spl_array_set_array(zval *object, spl_array_object *intern, zval
*ar
zend_object_get_properties_t handler = Z_OBJ_HANDLER_P(array, get_properties);
if (handler != zend_std_get_properties || Z_OBJ_HANDLER_P(array, get_properties_for)) {
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0,
- "Overloaded object of type %s is not compatible with %s",
- ZSTR_VAL(Z_OBJCE_P(array)->name), ZSTR_VAL(intern->std.ce->name));
+ "Overloaded object of type %pS is not compatible with %pS",
+ Z_OBJCE_P(array)->name, intern->std.ce->name);
ZEND_ASSERT(Z_TYPE(garbage) == IS_UNDEF);
return;
}
if (UNEXPECTED(Z_OBJCE_P(array)->ce_flags & ZEND_ACC_ENUM)) {
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0,
- "Enums are not compatible with %s",
- ZSTR_VAL(intern->std.ce->name));
+ "Enums are not compatible with %pS",
+ intern->std.ce->name);
ZEND_ASSERT(Z_TYPE(garbage) == IS_UNDEF);
return;
}
@@ -1493,15 +1493,15 @@ PHP_METHOD(ArrayObject, __unserialize)
if (!ce) {
zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
- "Cannot deserialize ArrayObject with iterator class '%s'; no such class
exists",
- ZSTR_VAL(Z_STR_P(iterator_class_zv)));
+ "Cannot deserialize ArrayObject with iterator class '%pS'; no such class
exists",
+ Z_STR_P(iterator_class_zv));
RETURN_THROWS();
}
if (!instanceof_function(ce, spl_ce_ArrayIterator)) {
zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
- "Cannot deserialize ArrayObject with iterator class '%s'; this class is not
derived from ArrayIterator",
- ZSTR_VAL(Z_STR_P(iterator_class_zv)));
+ "Cannot deserialize ArrayObject with iterator class '%pS'; this class is not
derived from ArrayIterator",
+ Z_STR_P(iterator_class_zv));
RETURN_THROWS();
}
@@ -1581,8 +1581,8 @@ static zval *spl_array_it_get_current_data(zend_object_iterator *iter) /* {{{
*/
if (EXPECTED(prop_info != NULL) && ZEND_TYPE_IS_SET(prop_info->type)) {
if (prop_info->flags & ZEND_ACC_READONLY) {
zend_throw_error(NULL,
- "Cannot acquire reference to readonly property %s::$%s",
- ZSTR_VAL(prop_info->ce->name), ZSTR_VAL(key));
+ "Cannot acquire reference to readonly property %pS::$%pS",
+ prop_info->ce->name, key);
return NULL;
}
ZVAL_NEW_REF(data, data);
diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c
index 914c0206b5c6..85a979829cfa 100644
--- a/ext/spl/spl_directory.c
+++ b/ext/spl/spl_directory.c
@@ -302,7 +302,7 @@ static void spl_filesystem_dir_open(spl_filesystem_object* intern, zend_string *
if (!EG(exception)) {
/* open failed w/out notice (turned to exception due to EH_THROW) */
zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
- "Failed to open directory \"%s\"", ZSTR_VAL(path));
+ "Failed to open directory \"%pS\"", path);
}
} else {
do {
@@ -333,7 +333,7 @@ static zend_result spl_filesystem_file_open(spl_filesystem_object *intern, bool
if (!ZSTR_LEN(intern->file_name) || !intern->u.file.stream) {
if (!EG(exception)) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Cannot open file '%s'",
ZSTR_VAL(intern->file_name));
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Cannot open file
'%pS'", intern->file_name);
}
zend_string_release(intern->u.file.open_mode);
intern->u.file.open_mode = NULL;
@@ -709,7 +709,7 @@ static void spl_filesystem_object_construct(INTERNAL_FUNCTION_PARAMETERS, zend_l
/* spl_filesystem_dir_open() may emit an E_WARNING */
zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling);
if (SPL_HAS_FLAG(ctor_flags, DIT_CTOR_GLOB) && !zend_string_starts_with_literal(path,
"glob://")) {
- path = zend_strpprintf(0, "glob://%s", ZSTR_VAL(path));
+ path = zend_strpprintf(0, "glob://%pS", path);
spl_filesystem_dir_open(intern, path);
zend_string_release(path);
} else {
@@ -1207,7 +1207,7 @@ PHP_METHOD(SplFileInfo, getLinkTarget)
#endif
if (ret == -1) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Unable to read link %s, error:
%s", ZSTR_VAL(intern->file_name), strerror(errno));
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Unable to read link %pS, error:
%s", intern->file_name, strerror(errno));
RETVAL_FALSE;
} else {
/* Append NULL to the end of the string */
@@ -1318,7 +1318,7 @@ PHP_METHOD(SplFileInfo, getPathInfo)
if (ce == NULL) {
ce = intern->info_class;
} else if (!instanceof_function(ce, spl_ce_SplFileInfo)) {
- zend_argument_type_error(1, "must be a class name derived from %s or null, %s given",
ZSTR_VAL(spl_ce_SplFileInfo->name), ZSTR_VAL(ce->name));
+ zend_argument_type_error(1, "must be a class name derived from %pS or null, %pS given",
spl_ce_SplFileInfo->name, ce->name);
RETURN_THROWS();
}
@@ -1503,7 +1503,7 @@ PHP_METHOD(RecursiveDirectoryIterator, getSubPathname)
ZEND_PARSE_PARAMETERS_NONE();
if (intern->u.dir.sub_path) {
- RETURN_NEW_STR(strpprintf(0, "%s%c%s", ZSTR_VAL(intern->u.dir.sub_path), slash,
intern->u.dir.entry.d_name));
+ RETURN_NEW_STR(strpprintf(0, "%pS%c%s", intern->u.dir.sub_path, slash,
intern->u.dir.entry.d_name));
} else {
RETURN_STRING(intern->u.dir.entry.d_name);
}
@@ -1776,7 +1776,7 @@ static zend_object_iterator *spl_filesystem_tree_get_iterator(zend_class_entry
*
static ZEND_COLD void spl_filesystem_file_cannot_read(spl_filesystem_object *intern)
{
- zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Cannot read from file %s",
ZSTR_VAL(intern->file_name));
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Cannot read from file %pS",
intern->file_name);
}
static zend_result spl_filesystem_file_read_ex(spl_filesystem_object *intern, bool silent,
zend_long line_add, bool csv)
@@ -1904,8 +1904,8 @@ static zend_result spl_filesystem_file_read_line_ex(zval * this_ptr,
spl_filesys
}
if (Z_TYPE(retval) != IS_STRING) {
- zend_type_error("%s::getCurrentLine(): Return value must be of type string, %s
returned",
- ZSTR_VAL(Z_OBJCE_P(this_ptr)->name), zend_zval_value_name(&retval));
+ zend_type_error("%pS::getCurrentLine(): Return value must be of type string, %s
returned",
+ Z_OBJCE_P(this_ptr)->name, zend_zval_value_name(&retval));
zval_ptr_dtor(&retval);
return FAILURE;
}
@@ -1942,7 +1942,7 @@ static void spl_filesystem_file_rewind(zval * this_ptr, spl_filesystem_object
*i
return;
}
if (-1 == php_stream_rewind(intern->u.file.stream)) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Cannot rewind file %s",
ZSTR_VAL(intern->file_name));
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Cannot rewind file %pS",
intern->file_name);
return;
}
@@ -2618,7 +2618,7 @@ PHP_METHOD(SplFileObject, ftruncate)
if (!php_stream_truncate_supported(intern->u.file.stream)) {
- zend_throw_exception_ex(spl_ce_LogicException, 0, "Can't truncate file %s",
ZSTR_VAL(intern->file_name));
+ zend_throw_exception_ex(spl_ce_LogicException, 0, "Can't truncate file %pS",
intern->file_name);
RETURN_THROWS();
}
diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c
index 5a6cc33cf86c..74298a04c947 100644
--- a/ext/spl/spl_heap.c
+++ b/ext/spl/spl_heap.c
@@ -1172,30 +1172,30 @@ PHP_METHOD(SplPriorityQueue, __unserialize)
ZEND_PARSE_PARAMETERS_END();
if (zend_hash_num_elements(data) != 2) {
- zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object",
ZSTR_VAL(intern->std.ce->name));
+ zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %pS object",
intern->std.ce->name);
RETURN_THROWS();
}
zval *props = zend_hash_index_find(data, 0);
if (!props || Z_TYPE_P(props) != IS_ARRAY) {
- zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object",
ZSTR_VAL(intern->std.ce->name));
+ zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %pS object",
intern->std.ce->name);
RETURN_THROWS();
}
object_properties_load(&intern->std, Z_ARRVAL_P(props));
if (EG(exception)) {
- zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object",
ZSTR_VAL(intern->std.ce->name));
+ zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %pS object",
intern->std.ce->name);
RETURN_THROWS();
}
zval *state = zend_hash_index_find(data, 1);
if (!state || Z_TYPE_P(state) != IS_ARRAY) {
- zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object",
ZSTR_VAL(intern->std.ce->name));
+ zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %pS object",
intern->std.ce->name);
RETURN_THROWS();
}
if (spl_heap_unserialize_internal_state(Z_ARRVAL_P(state), intern, ZEND_THIS, true) != SUCCESS) {
- zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object",
ZSTR_VAL(intern->std.ce->name));
+ zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %pS object",
intern->std.ce->name);
RETURN_THROWS();
}
@@ -1227,30 +1227,30 @@ PHP_METHOD(SplHeap, __unserialize)
}
if (zend_hash_num_elements(data) != 2) {
- zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object",
ZSTR_VAL(intern->std.ce->name));
+ zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %pS object",
intern->std.ce->name);
RETURN_THROWS();
}
zval *props = zend_hash_index_find(data, 0);
if (!props || Z_TYPE_P(props) != IS_ARRAY) {
- zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object",
ZSTR_VAL(intern->std.ce->name));
+ zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %pS object",
intern->std.ce->name);
RETURN_THROWS();
}
object_properties_load(&intern->std, Z_ARRVAL_P(props));
if (EG(exception)) {
- zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object",
ZSTR_VAL(intern->std.ce->name));
+ zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %pS object",
intern->std.ce->name);
RETURN_THROWS();
}
zval *state = zend_hash_index_find(data, 1);
if (!state || Z_TYPE_P(state) != IS_ARRAY) {
- zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object",
ZSTR_VAL(intern->std.ce->name));
+ zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %pS object",
intern->std.ce->name);
RETURN_THROWS();
}
if (spl_heap_unserialize_internal_state(Z_ARRVAL_P(state), intern, ZEND_THIS, false) != SUCCESS) {
- zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object",
ZSTR_VAL(intern->std.ce->name));
+ zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %pS object",
intern->std.ce->name);
RETURN_THROWS();
}
diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c
index 83a19bf638a8..c0a6928ec61d 100644
--- a/ext/spl/spl_iterators.c
+++ b/ext/spl/spl_iterators.c
@@ -524,8 +524,8 @@ static zend_result spl_get_iterator_from_aggregate(zval *retval, zend_class_entr
if (Z_TYPE_P(retval) != IS_OBJECT
|| !instanceof_function(Z_OBJCE_P(retval), zend_ce_traversable)) {
zend_throw_exception_ex(spl_ce_LogicException, 0,
- "%s::getIterator() must return an object that implements Traversable",
- ZSTR_VAL(ce->name));
+ "%pS::getIterator() must return an object that implements Traversable",
+ ce->name);
zval_ptr_dtor(retval);
return FAILURE;
}
@@ -905,7 +905,7 @@ static zend_function *spl_recursive_it_get_method(zend_object **zobject, zend_st
zval *zobj;
if (!object->iterators) {
- zend_throw_error(NULL, "The %s instance wasn't initialized properly",
ZSTR_VAL((*zobject)->ce->name));
+ zend_throw_error(NULL, "The %pS instance wasn't initialized properly",
(*zobject)->ce->name);
return NULL;
}
zobj = &object->iterators[level].zobject;
@@ -1250,8 +1250,8 @@ static zend_function *spl_dual_it_get_method(zend_object **object, zend_string
*
#define SPL_CHECK_CTOR(intern, classname) \
if (intern->dit_type == DIT_Unknown) { \
/* TODO Normal Error? */ \
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Classes derived from %s must call
%s::__construct()", \
- ZSTR_VAL((spl_ce_##classname)->name), ZSTR_VAL((spl_ce_##classname)->name)); \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Classes derived from %pS must
call %pS::__construct()", \
+ (spl_ce_##classname)->name, (spl_ce_##classname)->name); \
RETURN_THROWS(); \
}
@@ -1282,7 +1282,7 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS,
z
intern = Z_SPLDUAL_IT_P(ZEND_THIS);
if (intern->dit_type != DIT_Unknown) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s::getIterator() must be called
exactly once per instance", ZSTR_VAL(ce_base->name));
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%pS::getIterator() must be called
exactly once per instance", ce_base->name);
return NULL;
}
@@ -2402,7 +2402,7 @@ PHP_METHOD(CachingIterator, __toString)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
if (!(intern->u.caching.flags &
(CIT_CALL_TOSTRING|CIT_TOSTRING_USE_KEY|CIT_TOSTRING_USE_CURRENT|CIT_TOSTRING_USE_INNER))) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not fetch string value
(see CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name));
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%pS does not fetch string value
(see CachingIterator::__construct)", Z_OBJCE_P(ZEND_THIS)->name);
RETURN_THROWS();
}
@@ -2436,7 +2436,7 @@ PHP_METHOD(CachingIterator, offsetSet)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
if (!(intern->u.caching.flags & CIT_FULL_CACHE)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see
CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name));
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%pS does not use a full cache
(see CachingIterator::__construct)", Z_OBJCE_P(ZEND_THIS)->name);
RETURN_THROWS();
}
@@ -2459,12 +2459,12 @@ PHP_METHOD(CachingIterator, offsetGet)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
if (!(intern->u.caching.flags & CIT_FULL_CACHE)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see
CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name));
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%pS does not use a full cache
(see CachingIterator::__construct)", Z_OBJCE_P(ZEND_THIS)->name);
RETURN_THROWS();
}
if ((value = zend_symtable_find(Z_ARRVAL(intern->u.caching.zcache), key)) == NULL) {
- zend_error(E_WARNING, "Undefined array key \"%s\"", ZSTR_VAL(key));
+ zend_error(E_WARNING, "Undefined array key \"%pS\"", key);
return;
}
@@ -2485,7 +2485,7 @@ PHP_METHOD(CachingIterator, offsetUnset)
}
if (!(intern->u.caching.flags & CIT_FULL_CACHE)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see
CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name));
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%pS does not use a full cache
(see CachingIterator::__construct)", Z_OBJCE_P(ZEND_THIS)->name);
RETURN_THROWS();
}
@@ -2506,7 +2506,7 @@ PHP_METHOD(CachingIterator, offsetExists)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
if (!(intern->u.caching.flags & CIT_FULL_CACHE)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see
CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name));
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%pS does not use a full cache
(see CachingIterator::__construct)", Z_OBJCE_P(ZEND_THIS)->name);
RETURN_THROWS();
}
@@ -2524,7 +2524,7 @@ PHP_METHOD(CachingIterator, getCache)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
if (!(intern->u.caching.flags & CIT_FULL_CACHE)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see
CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name));
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%pS does not use a full cache
(see CachingIterator::__construct)", Z_OBJCE_P(ZEND_THIS)->name);
RETURN_THROWS();
}
@@ -2589,7 +2589,7 @@ PHP_METHOD(CachingIterator, count)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
if (!(intern->u.caching.flags & CIT_FULL_CACHE)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see
CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name));
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%pS does not use a full cache
(see CachingIterator::__construct)", Z_OBJCE_P(ZEND_THIS)->name);
RETURN_THROWS();
}
@@ -2819,7 +2819,7 @@ PHP_METHOD(AppendIterator, __construct)
/* TODO: This should be converted to a normal Error as this is triggered when calling the
constructor twice */
if (intern->dit_type != DIT_Unknown) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s::getIterator() must be called
exactly once per instance", ZSTR_VAL(spl_ce_AppendIterator->name));
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%pS::getIterator() must be called
exactly once per instance", spl_ce_AppendIterator->name);
RETURN_THROWS();
}
diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c
index 1869fde93e34..32c534a8bc6b 100644
--- a/ext/spl/spl_observer.c
+++ b/ext/spl/spl_observer.c
@@ -106,8 +106,8 @@ static zend_result spl_object_storage_get_hash(zend_hash_key *key, spl_SplObject
} else {
/* TODO PHP 9: Remove this as this will be enforced from the return type */
if (UNEXPECTED(Z_TYPE(rv) != IS_STRING)) {
- zend_type_error("%s::getHash(): Return value must be of type string, %s returned",
- ZSTR_VAL(intern->std.ce->name), zend_zval_value_name(&rv));
+ zend_type_error("%pS::getHash(): Return value must be of type string, %s returned",
+ intern->std.ce->name, zend_zval_value_name(&rv));
zval_ptr_dtor(&rv);
return FAILURE;
} else {