Skip to content

[Sync-EN] Document the exception handler stack behavior of PHP 8.3.0 and 8.3.5 - #1791

Open
lacatoire wants to merge 1 commit into
php:masterfrom
lacatoire:sync-en/1695
Open

[Sync-EN] Document the exception handler stack behavior of PHP 8.3.0 and 8.3.5#1791
lacatoire wants to merge 1 commit into
php:masterfrom
lacatoire:sync-en/1695

Conversation

@lacatoire

Copy link
Copy Markdown
Member

Syncs reference/errorfunc/functions/restore-exception-handler.xml and reference/errorfunc/functions/set-exception-handler.xml with php/doc-en#5222.

Both pages gain the note and the changelog describing the handler stack behaviour:

  • As of PHP 8.3.0 the engine unsets the active exception handler before invoking it, so an exception thrown by the handler is not passed back to it, and set_exception_handler() called from within a handler reports no previously defined handler.
  • As of PHP 8.3.5 the engine also pushes the handler it is about to invoke onto the stack, so restore_exception_handler() called from within a handler re-installs the handler that is currently running; restoring the one active before it takes two calls.
  • The running handler is re-installed automatically on return, but only if no handler is active at that point; a handler that touches the stack itself is left in charge of it, which is why modifying the exception handler from within itself is discouraged.

Both see-also simplelists are no longer wrapped in a para, as upstream.

EN-Revision bumped to 1cc803aaa07ac94ce8e3bfdf56f4b9ddd23326d3 on both files.

Fixes: #1695

@lacatoire
lacatoire requested a review from a team as a code owner August 31, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Sync EN] Document restore_exception_handler behavior change in PHP 8.3.5

1 participant