Skip to content

Commit 624a734

Browse files
committed
feat: allow arrow function as a class member
1 parent 9040e79 commit 624a734

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Zend/zend_language_parser.y

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,10 @@ attributed_class_statement:
959959
return_type backup_fn_flags method_body backup_fn_flags
960960
{ $$ = zend_ast_create_decl(ZEND_AST_METHOD, $3 | $1 | $12, $2, $5,
961961
zend_ast_get_str($4), $7, NULL, $11, $9, NULL); CG(extra_fn_flags) = $10; }
962+
| method_modifiers fn returns_ref identifier backup_doc_comment '(' parameter_list ')'
963+
return_type T_DOUBLE_ARROW backup_fn_flags backup_lex_pos expr backup_fn_flags ';'
964+
{ $$ = zend_ast_create_decl(ZEND_AST_METHOD, $3 | $1 | $14, $2, $5,
965+
zend_ast_get_str($4), $7, NULL, zend_ast_create(ZEND_AST_RETURN, $13), $9, NULL); CG(extra_fn_flags) = $11; }
962966
| enum_case { $$ = $1; }
963967
;
964968

0 commit comments

Comments
 (0)