Commit 35cd1b64033 for php.net
commit 35cd1b640337c9cc10608b79e3071e822d80709d
Author: Gina Peter Banyard <girgias@php.net>
Date: Fri Sep 11 23:58:51 2026 +0100
Zend/exception.c: improve getTraceAsString() method call setup (#23665)
zend_call_function() doesn't care about the calling scope, moreover if the FCC is set it doesn't care about the function_name and object fields of the FCI as those are only used for callability checks
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c
index 1b8297881d6..062ba0f3b18 100644
--- a/Zend/zend_exceptions.c
+++ b/Zend/zend_exceptions.c
@@ -746,11 +746,9 @@ ZEND_METHOD(Exception, __toString)
zend_fcall_info fci;
fci.size = sizeof(fci);
- ZVAL_UNDEF(&fci.function_name);
fci.retval = &trace;
fci.param_count = 0;
fci.params = NULL;
- fci.object = NULL;
fci.named_params = NULL;
zend_fcall_info_cache fcc;
@@ -765,7 +763,6 @@ ZEND_METHOD(Exception, __toString)
zend_long line = zval_get_long(GET_PROPERTY(exception, ZEND_STR_LINE));
fcc.object = Z_OBJ_P(exception);
- fcc.calling_scope = Z_OBJCE_P(exception);
zend_call_function(&fci, &fcc);
if (Z_TYPE(trace) != IS_STRING) {