Skip to content

Commit 643a727

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: Fix assertion failure in cufa optimization with named args
2 parents c91ea94 + c702202 commit 643a727

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
--TEST--
2+
call_user_func_array() + array_slice() + named arguments
3+
--FILE--
4+
<?php
5+
call_user_func_array('func', array_slice(array: $a, 1, 2));
6+
?>
7+
--EXPECTF--
8+
Fatal error: Cannot use positional argument after named argument in %s on line %d

Zend/zend_compile.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3973,6 +3973,7 @@ zend_result zend_compile_func_cufa(znode *result, zend_ast_list *args, zend_stri
39733973
zend_string *name = zend_resolve_function_name(orig_name, args->child[1]->child[0]->attr, &is_fully_qualified);
39743974

39753975
if (zend_string_equals_literal_ci(name, "array_slice")
3976+
&& !zend_args_contain_unpack_or_named(list)
39763977
&& list->children == 3
39773978
&& list->child[1]->kind == ZEND_AST_ZVAL) {
39783979
zval *zv = zend_ast_get_zval(list->child[1]);

0 commit comments

Comments
 (0)