diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 05b0d3c90d1..412fbaea36e 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -3146,13 +3146,11 @@ static void reflection_method_invoke(INTERNAL_FUNCTION_PARAMETERS, int variadic) fcc.called_scope = intern->ce; fcc.object = object ? Z_OBJ_P(object) : NULL; - if (!variadic) { - /* - * Copy the zend_function when calling via handler (e.g. Closure::__invoke()) - */ - if ((mptr->internal_function.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) { - fcc.function_handler = _copy_function(mptr); - } + /* + * Copy the zend_function when calling via handler (e.g. Closure::__invoke()) + */ + if ((mptr->internal_function.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) { + fcc.function_handler = _copy_function(mptr); } result = zend_call_function(&fci, &fcc);