@@ -287,7 +287,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
287287%type <ast> enum_declaration_statement enum_backing_type enum_case enum_case_expr
288288%type <ast> function_name non_empty_member_modifiers
289289%type <ast> property_hook property_hook_list optional_property_hook_list hooked_property property_hook_body
290- %type <ast> optional_parameter_list clone_argument_list non_empty_clone_argument_list
290+ %type <ast> optional_parameter_list clone_argument_list non_empty_clone_argument_list non_empty_array_function_argument_list array_function_argument
291291
292292%type <num> returns_ref function fn is_reference is_variadic property_modifiers property_hook_modifiers
293293%type <num> method_modifiers class_const_modifiers member_modifier optional_cpp_modifiers
@@ -1489,11 +1489,30 @@ ctor_arguments:
14891489
14901490dereferenceable_scalar :
14911491 T_ARRAY ' (' array_pair_list ' )' { $$ = $3 ; $$ ->attr = ZEND_ARRAY_SYNTAX_LONG; }
1492+ | T_ARRAY ' (' non_empty_array_function_argument_list possible_comma ' )'
1493+ { $$ = $3 ; $$ ->attr = ZEND_ARRAY_SYNTAX_FUNCTION; }
1494+ | T_ARRAY ' (' T_ELLIPSIS ' )' {
1495+ zend_ast *name = zend_ast_create_zval_from_str(ZSTR_KNOWN(ZEND_STR_ARRAY));
1496+ name->attr = ZEND_NAME_FQ;
1497+ $$ = zend_ast_create(ZEND_AST_CALL, name, zend_ast_create_fcc());
1498+ }
14921499 | ' [' array_pair_list ' ]' { $$ = $2 ; $$ ->attr = ZEND_ARRAY_SYNTAX_SHORT; }
14931500 | T_CONSTANT_ENCAPSED_STRING { $$ = $1 ; }
14941501 | ' "' encaps_list ' "' { $$ = $2 ; }
14951502;
14961503
1504+ non_empty_array_function_argument_list :
1505+ array_function_argument
1506+ { $$ = zend_ast_create_list(1 , ZEND_AST_ARRAY, $1 ); }
1507+ | non_empty_array_function_argument_list ' ,' array_function_argument
1508+ { $$ = zend_ast_list_add($1 , $3 ); }
1509+ ;
1510+
1511+ array_function_argument :
1512+ identifier ' :' expr
1513+ { $$ = zend_ast_create(ZEND_AST_NAMED_ARG, $1 , $3 ); }
1514+ ;
1515+
14971516scalar :
14981517 T_LNUMBER { $$ = $1 ; }
14991518 | T_DNUMBER { $$ = $1 ; }
0 commit comments