Document restore_exception_handler behavior change in PHP 8.3.5 - #5222
Merged
lacatoire merged 1 commit intoAug 25, 2026
Merged
Conversation
lacatoire
force-pushed
the
doc/exception-handler-behavior-php84
branch
2 times, most recently
from
August 21, 2026 10:04
b3719be to
8f99e17
Compare
lacatoire
force-pushed
the
doc/exception-handler-behavior-php84
branch
from
August 25, 2026 09:22
c08ae5d to
3aed4a2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Document the current exception handler stack behavior, which changed in two steps.
Since PHP 8.3.0 the engine unsets the active handler before invoking it, so no handler is active while one runs. Since PHP 8.3.5 it also pushes the handler it is about to invoke onto the handler stack, and re-installs it once it returns, but only if no handler is active at that point. Consequences documented on both pages:
restore_exception_handler()called from within a handler re-installs the handler that is currently running, so restoring the handler that was active before it requires two calls;set_exception_handler()orrestore_exception_handler(), the automatic restoration is skipped and the handler is left in charge of the stack.Verified against the official CLI images: 7.4.33, 8.1.34, 8.2.28 and 8.3.4 show the previous behavior, 8.3.6, 8.4.24 and 8.5.4 the new one. The change is not present in the 8.2 branch.
Also unwraps the
<simplelist>of bothseealsosections from its<para>.Sources
NEWSentryFixed bug GH-13446 (Restore exception handler after it finishes).Fixes #5102