GH-16317: make __debugInfo() overrides work#16333
GH-16317: make __debugInfo() overrides work#16333DanielEScherzer wants to merge 1 commit intophp:masterfrom
__debugInfo() overrides work#16333Conversation
iluuu1994
left a comment
There was a problem hiding this comment.
Arguably, those extensions don't correctly handle the ZEND_PROP_PURPOSE_DEBUG flag in their get_properties_for handler. This may even accidentally circumvent handling of ZEND_PROP_PURPOSE_DEBUG in correctly implemented handlers. It's true that they could instead implement get_debug_info, or simply __debugInfo. This is (likely) historical, so right now we need to support all of these cases.
| // GH-16317: for user classes with __debugInfo() always call that | ||
| if (ce->type == ZEND_USER_CLASS && ce->__debugInfo != NULL) { | ||
| int is_temp; | ||
| myht = (std_object_handlers.get_debug_info)(zobj, &is_temp); |
There was a problem hiding this comment.
get_debug_info is technically an optional handler.
There was a problem hiding this comment.
Generally it is optional, but can it ever be unset from the global std_object_handlers?
There was a problem hiding this comment.
Yes, the default handlers may be removed. I don't know exactly why you would do that, but it is currently marked as optional, and its existence is checked for within zend_std_get_properties_for().
|
Thanks, I reopened GH-12534. Let's close this PR then. |
No description provided.