Commit af7a6c704a2 for php.net
commit af7a6c704a2125ba8fb5b6fb2d9590622074133a
Author: Gina Peter Banyard <girgias@php.net>
Date: Thu Jul 30 21:33:41 2026 +0100
Zend: remove goto in zend_is_callable_at_frame()
But moving the call into the switch statement rather than trying to understand this code flow.
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 5e5f39213f3..28f24774b71 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -4186,7 +4186,6 @@ ZEND_API bool zend_is_callable_at_frame(
return 1;
}
-check_func:
ret = zend_is_string_callable(Z_STR_P(callable), frame, fcc, strict_class, error, check_flags & IS_CALLABLE_SUPPRESS_DEPRECATIONS);
if (fcc == &fcc_local) {
zend_release_fcall_info_cache(fcc);
@@ -4238,10 +4237,13 @@ ZEND_API bool zend_is_callable_at_frame(
}
}
- callable = method;
- goto check_func;
+ ret = zend_is_string_callable(Z_STR_P(method), frame, fcc, strict_class, error, check_flags & IS_CALLABLE_SUPPRESS_DEPRECATIONS);
+ if (fcc == &fcc_local) {
+ zend_release_fcall_info_cache(fcc);
+ }
+ return ret;
}
- return 0;
+
case IS_OBJECT:
if (Z_OBJ_HANDLER_P(callable, get_closure) && Z_OBJ_HANDLER_P(callable, get_closure)(Z_OBJ_P(callable), &fcc->calling_scope, &fcc->function_handler, &fcc->object, 1) == SUCCESS) {
fcc->called_scope = fcc->calling_scope;