View Issue Details

IDProjectCategoryView StatusLast Update
0002195XdebugStacktracespublic2023-11-30 14:49
Reporterderick Assigned To 
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status closedResolutionfixed 
Target Version3.3devFixed in Version3.3.0 
Summary0002195: Add 'from_exception' option to 'xdebug_get_function_stack' to return the stack trace where an exception was thrown
Description

The xdebug_get_function_stack() method returns the stack trace where it was called. Inside an exception handler, set with set_exception_handler() this then returns the stack trace from within that handler, but not the stack trace from where the exception was called, which is much more interesting.

Add a new option to xdebug_get_function_stack() called from_exception that takes a Throwable as argument, and if a stack trace is available when this throwable was created, return it, instead of the stack trace from where it was called. This stack trace will always have local_vars and params_as_values set, so that these argument and local variable values can be accessed.

TagsNo tags attached.
Operating System
PHP Version8.2.0-8.2.9

Activities