Re: Debug information output in the PHP debug build

From: Date: Fri, 27 Mar 2026 19:20:50 +0000
Subject: Re: Debug information output in the PHP debug build
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-130471@lists.php.net to get a copy of this message
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

« previous php.internals (#130471) next »