@@ -278,6 +278,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
278278%type <ast> attribute_decl attribute attributes attribute_group namespace_declaration_name
279279%type <ast> match match_arm_list non_empty_match_arm_list match_arm match_arm_cond_list
280280%type <ast> enum_declaration_statement enum_backing_type enum_case enum_case_expr
281+ %type <ast> function_name
281282
282283%type <num> returns_ref function fn is_reference is_variadic variable_modifiers
283284%type <num> method_modifiers non_empty_member_modifiers member_modifier
@@ -560,8 +561,17 @@ unset_variable:
560561 variable { $$ = zend_ast_create(ZEND_AST_UNSET, $1 ); }
561562;
562563
564+ function_name :
565+ T_STRING { $$ = $1 ; }
566+ | T_READONLY {
567+ zval zv;
568+ if (zend_lex_tstring(&zv, $1 ) == FAILURE) { YYABORT ; }
569+ $$ = zend_ast_create_zval(&zv);
570+ }
571+ ;
572+
563573function_declaration_statement :
564- function returns_ref T_STRING backup_doc_comment ' (' parameter_list ' )' return_type
574+ function returns_ref function_name backup_doc_comment ' (' parameter_list ' )' return_type
565575 backup_fn_flags ' {' inner_statement_list ' }' backup_fn_flags
566576 { $$ = zend_ast_create_decl(ZEND_AST_FUNC_DECL, $2 | $13 , $1 , $4 ,
567577 zend_ast_get_str ($3 ), $6, NULL, $11, $8, NULL); CG(extra_fn_flags) = $9 ; }
@@ -1270,6 +1280,11 @@ lexical_var:
12701280function_call :
12711281 name argument_list
12721282 { $$ = zend_ast_create(ZEND_AST_CALL, $1 , $2 ); }
1283+ | T_READONLY argument_list {
1284+ zval zv;
1285+ if (zend_lex_tstring(&zv, $1 ) == FAILURE) { YYABORT ; }
1286+ $$ = zend_ast_create(ZEND_AST_CALL, zend_ast_create_zval(&zv), $2 );
1287+ }
12731288 | class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list
12741289 { $$ = zend_ast_create(ZEND_AST_STATIC_CALL, $1 , $3 , $4 ); }
12751290 | variable_class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list
0 commit comments