Skip to content

Commit 0f07993

Browse files
committed
reflection: Simplify check for Closure::__invoke() in instantiate_reflection_method()
1 parent 1096ea1 commit 0f07993

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

ext/reflection/php_reflection.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3302,10 +3302,7 @@ static void instantiate_reflection_method(INTERNAL_FUNCTION_PARAMETERS, bool is_
33023302

33033303
lcname = zend_str_tolower_dup(method_name, method_name_len);
33043304

3305-
if (ce == zend_ce_closure && orig_obj && (method_name_len == sizeof(ZEND_INVOKE_FUNC_NAME)-1)
3306-
&& memcmp(lcname, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
3307-
&& (mptr = zend_get_closure_invoke_method(orig_obj)) != NULL)
3308-
{
3305+
if (is_closure_invoke(ce, lcname) && orig_obj && (mptr = zend_get_closure_invoke_method(orig_obj)) != NULL) {
33093306
/* Store the original closure object so we can validate it in invoke/invokeArgs.
33103307
* Each closure has a unique __invoke signature, so we must reject different closures. */
33113308
ZVAL_OBJ_COPY(&intern->obj, orig_obj);

0 commit comments

Comments
 (0)