Use-after-free via repopulation of last fatal error backtrace global after shutdown.
A fatal error raised while modified INI settings are restored during request shutdown can repopulate the stored fatal error backtrace after the executor has been cleaned up. The request memory is then freed, and a diagnostic emitted before executor initialization in a later request handled by the same PHP-FPM or mod php worker can access the stale backtrace. The shutdown error requires per-path configuration of max memory limit, or of zlib.output compression together with output handler (which .user.ini can also set). The early diagnostic requires Apache per-directory configuration or, for PHP-FPM, a PHP VALUE or PHP ADMIN VALUE parameter sent by the front end. This can cause memory corruption and worker crashes, and may allow remote code execution.
This issue affects PHP versions 8.5.* before 8.5.13.