Skip to content

Commit 75bd1a9

Browse files
committed
Merge branch 'PHP-8.4'
* PHP-8.4: Fix may_have_extra_named_args flag for ZEND_AST_UNPACK
2 parents c218f62 + 0b12db6 commit 75bd1a9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Zend/zend_compile.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3749,6 +3749,12 @@ static uint32_t zend_compile_args(
37493749
"Cannot use argument unpacking after named arguments");
37503750
}
37513751

3752+
/* Unpack may contain named arguments. */
3753+
may_have_undef = 1;
3754+
if (!fbc || (fbc->common.fn_flags & ZEND_ACC_VARIADIC)) {
3755+
*may_have_extra_named_args = 1;
3756+
}
3757+
37523758
uses_arg_unpack = 1;
37533759
fbc = NULL;
37543760

@@ -3757,11 +3763,6 @@ static uint32_t zend_compile_args(
37573763
opline->op2.num = arg_count;
37583764
opline->result.var = EX_NUM_TO_VAR(arg_count - 1);
37593765

3760-
/* Unpack may contain named arguments. */
3761-
may_have_undef = 1;
3762-
if (!fbc || (fbc->common.fn_flags & ZEND_ACC_VARIADIC)) {
3763-
*may_have_extra_named_args = 1;
3764-
}
37653766
continue;
37663767
}
37673768

0 commit comments

Comments
 (0)