Commit 184402b6704 for php
commit 184402b670490735111363509fd810e42f327b71
Author: Gina Peter Banyard <girgias@php.net>
Date: Tue Sep 29 17:36:36 2026 +0100
Zend: replace zend_is_callable_ex with non-ex version
As the new signature is actually useful now
diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c
index d4c0b588136..9d5971fac47 100644
--- a/Zend/zend_closures.c
+++ b/Zend/zend_closures.c
@@ -399,7 +399,7 @@ static zend_result zend_create_closure_from_callable(zval *return_value, zval *c
zend_function *mptr;
zend_internal_function call;
- if (!zend_is_callable_ex(callable, NULL, 0, NULL, &fcc, error)) {
+ if (!zend_is_callable(callable, &fcc, error)) {
return FAILURE;
}
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 9c9e262169f..d1355208c28 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -3985,10 +3985,10 @@ ZEND_VM_HANDLER(118, ZEND_INIT_USER_CALL, CONST, CONST|TMP|CV, NUM)
SAVE_OPLINE();
function_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
- if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) {
+ if (zend_is_callable(function_name, &fcc, &error)) {
ZEND_ASSERT(!error);
- /* Deprecation can be emitted from zend_is_callable_ex(), which can
+ /* Deprecation can be emitted from zend_is_callable(), which can
* invoke a user error handler and throw an exception.
* For the CONST and CV case we reuse the same exception block below
* to make sure we don't increase VM size too much. */
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 942f18eb704..fe2df85c23e 100644
Binary files a/Zend/zend_vm_execute.h and b/Zend/zend_vm_execute.h differ
diff --git a/ext/dom/xpath_callbacks.c b/ext/dom/xpath_callbacks.c
index e4ad6c59b3d..e0f75fbf6a7 100644
--- a/ext/dom/xpath_callbacks.c
+++ b/ext/dom/xpath_callbacks.c
@@ -204,7 +204,7 @@ static zend_result php_dom_xpath_callback_ns_update_method_handler(
ZEND_HASH_FOREACH_STR_KEY_VAL(callable_ht, key, entry) {
zend_fcall_info_cache* fcc = emalloc(sizeof(*fcc));
char *error;
- if (!zend_is_callable_ex(entry, NULL, 0, NULL, fcc, &error)) {
+ if (!zend_is_callable(entry, fcc, &error)) {
zend_argument_type_error(1, "must be an array with valid callbacks as values, %s", error);
efree(fcc);
efree(error);
@@ -251,7 +251,7 @@ static zend_result php_dom_xpath_callback_ns_update_method_handler(
char *error;
zval tmp;
ZVAL_STR(&tmp, name);
- if (!zend_is_callable_ex(&tmp, NULL, 0, NULL, fcc, &error)) {
+ if (!zend_is_callable(&tmp, fcc, &error)) {
zend_argument_type_error(1, "must be a callable, %s", error);
efree(fcc);
efree(error);
diff --git a/ext/ffi/ffi.c b/ext/ffi/ffi.c
index 37a0a215262..0f6e7626d83 100644
--- a/ext/ffi/ffi.c
+++ b/ext/ffi/ffi.c
@@ -1006,7 +1006,7 @@ static void *zend_ffi_create_callback(zend_ffi_type *type, zval *value) /* {{{ *
return NULL;
}
- if (!zend_is_callable_ex(value, NULL, 0, NULL, &fcc, &error)) {
+ if (!zend_is_callable(value, &fcc, &error)) {
zend_throw_error(zend_ffi_exception_ce, "Attempt to assign an invalid callback, %s", error);
return NULL;
}
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
index 0466dd4bf65..854227318da 100644
--- a/ext/openssl/xp_ssl.c
+++ b/ext/openssl/xp_ssl.c
@@ -2007,7 +2007,7 @@ static zend_result php_openssl_validate_and_allocate_psk_callback(
char *is_callable_error = NULL;
zend_fcall_info_cache fcc = {0};
- if (!zend_is_callable_ex(callable, NULL, 0, NULL, &fcc, &is_callable_error)) {
+ if (!zend_is_callable(callable, &fcc, &is_callable_error)) {
if (is_callable_error) {
zend_type_error("%s must be a valid callback, %s",
callback_name, is_callable_error);
@@ -2130,7 +2130,7 @@ static zend_result php_openssl_setup_server_early_data(php_stream *stream,
char *is_callable_error = NULL;
zend_fcall_info_cache fcc = {0};
- if (!zend_is_callable_ex(val, NULL, 0, NULL, &fcc, &is_callable_error)) {
+ if (!zend_is_callable(val, &fcc, &is_callable_error)) {
if (is_callable_error) {
zend_type_error("early_data_cb must be a valid callback, %s", is_callable_error);
efree(is_callable_error);
@@ -2318,7 +2318,7 @@ static zend_result php_openssl_validate_and_allocate_session_callback(
/* Validate callable */
zend_fcall_info_cache fcc;
- if (!zend_is_callable_ex(callable, NULL, 0, NULL, &fcc, &is_callable_error)) {
+ if (!zend_is_callable(callable, &fcc, &is_callable_error)) {
if (is_callable_error) {
zend_type_error("%s must be a valid callback, %s", callback_name, is_callable_error);
efree(is_callable_error);
diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c
index c73478fe583..0a40bd0f2df 100644
--- a/ext/pcntl/pcntl.c
+++ b/ext/pcntl/pcntl.c
@@ -842,7 +842,7 @@ PHP_FUNCTION(pcntl_signal)
RETURN_TRUE;
}
- if (!zend_is_callable_ex(handle, NULL, 0, NULL, NULL, NULL)) {
+ if (!zend_is_callable(handle, NULL, NULL)) {
PCNTL_G(last_error) = EINVAL;
zend_argument_type_error(2, "must be of type callable|int, %s given", zend_zval_value_name(handle));
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 4c63ab0920a..fce1a21a6c2 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -2459,7 +2459,7 @@ PHP_FUNCTION(preg_replace_callback_array)
/* Copy potential trampoline */
ZVAL_COPY_VALUE(&fci.function_name, replace);
- if (!zend_is_callable_ex(replace, NULL, 0, NULL, &fcc, NULL)) {
+ if (!zend_is_callable(replace, &fcc, NULL)) {
zend_argument_type_error(1, "must contain only valid callbacks");
goto error;
}
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index 9774b197b7d..4b56dbdbbd5 100644
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@ -1116,7 +1116,7 @@ static bool pdo_get_fcc_from_zval(zend_fcall_info_cache *fcc, zval *callable) {
}
char *is_callable_error = NULL;
- if (!zend_is_callable_ex(callable, NULL, 0, NULL, fcc, &is_callable_error)) {
+ if (!zend_is_callable(callable, fcc, &is_callable_error)) {
if (is_callable_error) {
zend_type_error("%s", is_callable_error);
efree(is_callable_error);
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 7552b00c115..b1968d9ff11 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -5142,7 +5142,7 @@ void reflection_class_new_lazy(INTERNAL_FUNCTION_PARAMETERS,
/* Call trampoline has been cleared by zpp. Refetch it, because we want to deal
* with it ourselves. It is important that it is not refetched on every call,
* because calls may occur from different scopes. */
- zend_is_callable_ex(&fci.function_name, NULL, 0, NULL, &fcc, NULL);
+ zend_is_callable(&fci.function_name, &fcc, NULL);
}
obj = zend_object_make_lazy(obj, ce, &fci.function_name, &fcc,
diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c
index 90341109210..6502ac279e2 100644
--- a/ext/standard/streamsfuncs.c
+++ b/ext/standard/streamsfuncs.c
@@ -967,7 +967,7 @@ static zend_result parse_context_params(php_stream_context *context, const HashT
zend_fcall_info_cache *fcc = emalloc(sizeof(*fcc));
char *error;
- if (!zend_is_callable_ex(tmp, NULL, 0, NULL, fcc, &error)) {
+ if (!zend_is_callable(tmp, fcc, &error)) {
zend_argument_type_error(1, "must be an array with valid callbacks as values, %s", error);
efree(fcc);
efree(error);
diff --git a/main/streams/stream_errors.c b/main/streams/stream_errors.c
index e16d3425a4d..788dceff445 100644
--- a/main/streams/stream_errors.c
+++ b/main/streams/stream_errors.c
@@ -369,7 +369,7 @@ static void php_stream_call_error_handler(const zval *handler, zval *errors_arra
zend_fcall_info_cache fcc;
char *is_callable_error = NULL;
- if (!zend_is_callable_ex(handler, NULL, 0, NULL, &fcc, &is_callable_error)) {
+ if (!zend_is_callable(handler, &fcc, &is_callable_error)) {
if (is_callable_error) {
zend_type_error("stream error handler must be a valid callback, %s", is_callable_error);
efree(is_callable_error);