diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index a78523d493f7..dbd8c9dc17fd 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3661,6 +3661,12 @@ static uint32_t zend_compile_args( "Cannot use argument unpacking after named arguments"); } + /* Unpack may contain named arguments. */ + may_have_undef = 1; + if (!fbc || (fbc->common.fn_flags & ZEND_ACC_VARIADIC)) { + *may_have_extra_named_args = 1; + } + uses_arg_unpack = 1; fbc = NULL; @@ -3669,11 +3675,6 @@ static uint32_t zend_compile_args( opline->op2.num = arg_count; opline->result.var = EX_NUM_TO_VAR(arg_count - 1); - /* Unpack may contain named arguments. */ - may_have_undef = 1; - if (!fbc || (fbc->common.fn_flags & ZEND_ACC_VARIADIC)) { - *may_have_extra_named_args = 1; - } continue; }