Hi

Am 2026-03-27 10:35, schrieb Edmond Dantes:
When a regular PHP exception or ASSERT is triggered, output two
backtraces: one for PHP and one for C.
To avoid breaking existing tests, this output could be optionally
suppressed via `php.ini`.

I don't think having a C-level backtrace for a PHP-level Exception is particularly useful. It will usually just point towards the ZEND_THROW opcode.

For failed assertions, PHP will already abort, which (when properly configured) will result in a coredump that can be investigated with gdb - and if it's reproducible you can just run in gdb directly and don't need to rely on coredumps. PHP also includes a `.gdbinit` script that provides a `zbacktrace` helper to generate a PHP-level stacktrace from within gdb.

So I don't quite see how including C-level backtrace generation within PHP itself will make things easier vs. just adding complexity. When developing PHP you can just use gdb, which will also allow you to step through the code.

Best regards
Tim Düsterhus

Reply via email to