Skip to content

Commit 945f315

Browse files
committed
Reflection: Copy invoke function also in the variadic case
It doesn't matter how the parameters are provided, we always have to copy the trampoline invoke function.
1 parent db80e0e commit 945f315

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

ext/reflection/php_reflection.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3332,13 +3332,11 @@ static void reflection_method_invoke(INTERNAL_FUNCTION_PARAMETERS, int variadic)
33323332
fcc.called_scope = intern->ce;
33333333
fcc.object = object ? Z_OBJ_P(object) : NULL;
33343334

3335-
if (!variadic) {
3336-
/*
3337-
* Copy the zend_function when calling via handler (e.g. Closure::__invoke())
3338-
*/
3339-
if ((mptr->internal_function.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) {
3340-
fcc.function_handler = _copy_function(mptr);
3341-
}
3335+
/*
3336+
* Copy the zend_function when calling via handler (e.g. Closure::__invoke())
3337+
*/
3338+
if ((mptr->internal_function.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) {
3339+
fcc.function_handler = _copy_function(mptr);
33423340
}
33433341

33443342
result = zend_call_function(&fci, &fcc);

0 commit comments

Comments
 (0)