Skip to content

Zend: change signature of zend_is_callable() - #23996

Closed
Girgias wants to merge 4 commits into
php:masterfrom
Girgias:2026-09-refactor-zend_is_callable
Closed

Girgias wants to merge 4 commits into
php:masterfrom
Girgias:2026-09-refactor-zend_is_callable

Conversation

@Girgias

@Girgias Girgias commented Sep 29, 2026

Copy link
Copy Markdown
Member

The current signature of zend_is_callable() has a single use showcasing how useless this definition of it is.

These commits change the signature from bool zend_is_callable(const zval *callable, uint32_t check_flags, zend_string **callable_name) to bool zend_is_callable(const zval *callable, zend_fcall_info_cache *fcc, char **error) and utilize this newer signature when possible.

The current signature is effectively useless every call uses the _ex variant to be able to grab the FCC and usually the error message.
Something the current signature does not provide, and instead offers parameters that most call sites don't care about.
As the new signature is actually useful now
Comment thread UPGRADING.INTERNALS Outdated
header interoperability is not required.
- The signature of zend_is_callable() has been changed to
zend_is_callable(const zval *callable, zend_fcall_info_cache *fcc, char **error)
from zend_is_callable(const zval *callable, uint32_t check_flags, zend_string **callable_name)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing . at the end, and perhaps add justification: “Allowing to simplify the most common case for zend_is_callable_ex()” or something like that: The goal if for folks to not needing to use zend_is_callable_ex() and making it explicit that they might be able to simplify is probably valuable.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improved wording, let me know what you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works

@TimWolla TimWolla left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Splendid.

@Girgias Girgias closed this in dfbaf9e Sep 29, 2026
@Girgias
Girgias deleted the 2026-09-refactor-zend_is_callable branch September 29, 2026 21:51
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.

2 participants