Skip to content

Zend: Store user error handler as an FCC - #23002

Draft
Girgias wants to merge 6 commits into
php:masterfrom
Girgias:2026-08-set_error_handler_fcc_convertion
Draft

Zend: Store user error handler as an FCC#23002
Girgias wants to merge 6 commits into
php:masterfrom
Girgias:2026-08-set_error_handler_fcc_convertion

Conversation

@Girgias

@Girgias Girgias commented Aug 3, 2026

Copy link
Copy Markdown
Member

Currently marking as draft as I'm not sure I have a good solution to handle the static method case as they can be represented as Class::method or ['Class', 'method'], and zend_get_callable_zval_from_fcc() always returns them as an array.

I also need more tests to confirm trampolines are handled correctly.

However, storing the error handler as an FCC will prevent redetermining if the zval is callable at every single invocation of said error handler, which I expect happens somewhat regularly.

Moreover, the refactoring here effectively cleans up the fix for the bugsnet bug 63206 done in #5206 by effectively tracking the error handler position on the stack so that we don't need to make a copy of the error handler.

Girgias added 2 commits August 3, 2026 02:08
To prevent needing to include all of zend_API.h just to have access to those structs
@Girgias
Girgias force-pushed the 2026-08-set_error_handler_fcc_convertion branch from 90d96fa to da1d765 Compare August 3, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant