[Observer] Pass zend_execute_data instead of zend_function to fcall init #6209
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.
This changes the observer API signature for
zend_observer_fcall_init
:The motivation for this change is to prevent extensions from having to check executor globals for the current execute_data during function call init. (See this example from @trowski's work on
amphp/ext-fiber
.)A previous implementation of the observer API initialized the function call from runtime cache initialization before execute_data was allocated which is why
zend_function
was passed in instead. But now that the observer API is implemented via opcode specialization, it makes sense to pass in the execute_data.This also keeps the API a bit more consistent for existing extensions that already hook
zend_execute_ex
./cc @morrisonlevi and @beberlei