kint-php / kint

Kint - Advanced PHP dumper
https://kint-php.github.io/kint/
MIT License
2.77k stars 291 forks source link

configuration to have xdebug_get_function_stack #274

Closed zainengineer closed 1 year ago

zainengineer commented 6 years ago

is it possible to have a configuration which uses xdebug_get_function_stack instead of debug_backtrace ? https://github.com/kint-php/kint/blob/b091715eadaf6e1a7ef927f3e81d1004611d2aea/src/Kint.php#L192

Its useful if you want to print trace inside fatal errors.

easy to see stack trace inside fatal errors.

jnvsor commented 6 years ago

You could just d(xdebug_get_function_stack());. I'd need to write a new plugin to support it like a normal backtrace. If you feel like writing one yourself that's also cool

jnvsor commented 1 year ago

Looking at this in depth (After all this time, yeah I know) the main difference between this and debug_backtrace() seems to be that this will include PHP internal functions that are omitted from normal backtraces and preserve the "Stack" in a shutdown handler yes?

Otherwise it just seems to be a reversed backtrace with string representations of parameters and no object key. Applying any "Special" transformations to this like we do to debug_backtrace would just blow away any extra information you might get out of it (Since any extra info would just be internal functions without source code to show)

If anyone still wants to implement this third party take a look at TracePlugin for reference, but it's one of the more complex ones.