1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Zend: remove zend_make_callable() function (#20269)

The name of this function is confusing, it doesn't make a zval callable just normalizes strings to an array pair if the string references a static method.
In general, to store a userland function it is encouraged to store the resolved FCC rather than the zval.

Moreover, a sourcegraph search shows no usage of this API in external open source code.
This commit is contained in:
Gina Peter Banyard
2025-10-26 18:28:40 +00:00
committed by GitHub
parent 23674d9482
commit c0214e49d2
3 changed files with 4 additions and 19 deletions

View File

@@ -35,6 +35,10 @@ PHP 8.6 INTERNALS UPGRADE NOTES
. The zval_dtor() alias of zval_ptr_dtor_nogc() has been removed.
Call zval_ptr_dtor_nogc() directly instead.
. The internal zend_copy_parameters_array() function is no longer exposed.
. The zend_make_callable() function has been removed, if a callable zval
needs to be obtained use the zend_get_callable_zval_from_fcc() function
instead. If this was used to store a callable, then an FCC should be
stored instead.
========================
2. Build system changes

View File

@@ -4232,24 +4232,6 @@ ZEND_API bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string
}
/* }}} */
ZEND_API bool zend_make_callable(zval *callable, zend_string **callable_name) /* {{{ */
{
zend_fcall_info_cache fcc;
if (zend_is_callable_ex(callable, NULL, IS_CALLABLE_SUPPRESS_DEPRECATIONS, callable_name, &fcc, NULL)) {
if (Z_TYPE_P(callable) == IS_STRING && fcc.calling_scope) {
zval_ptr_dtor_str(callable);
array_init(callable);
add_next_index_str(callable, zend_string_copy(fcc.calling_scope->name));
add_next_index_str(callable, zend_string_copy(fcc.function_handler->common.function_name));
}
zend_release_fcall_info_cache(&fcc);
return 1;
}
return 0;
}
/* }}} */
ZEND_API zend_result zend_fcall_info_init(zval *callable, uint32_t check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string **callable_name, char **error) /* {{{ */
{
if (!zend_is_callable_ex(callable, NULL, check_flags, callable_name, fcc, error)) {

View File

@@ -417,7 +417,6 @@ ZEND_API bool zend_is_callable_at_frame(
uint32_t check_flags, zend_fcall_info_cache *fcc, char **error);
ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error);
ZEND_API bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name);
ZEND_API bool zend_make_callable(zval *callable, zend_string **callable_name);
ZEND_API const char *zend_get_module_version(const char *module_name);
ZEND_API zend_result zend_get_module_started(const char *module_name);