[php-src] master: Zend/exception.c: improve getTraceAsString() method call setup (#23665)
| From: | Gina Peter Banyard via GitHub | Date: | Fri, 11 Sep 2026 22:58:54 +0000 |
| Subject: | [php-src] master: Zend/exception.c: improve getTraceAsString() method call setup (#23665) | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-141168@lists.php.net to get a copy of this message | ||
Author: Gina Peter Banyard (Girgias)
Committer: GitHub (web-flow)
Pusher: Girgias
Date: 2026-09-11T23:58:51+01:00
Commit: https://github.com/php/php-src/commit/35cd1b640337c9cc10608b79e3071e822d80709d
Raw diff: https://github.com/php/php-src/commit/35cd1b640337c9cc10608b79e3071e822d80709d.diff
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
Changed paths:
M Zend/zend_exceptions.c
Diff:
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c
index 1b8297881d60..062ba0f3b188 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) {