@@ -285,6 +285,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
285285%type <ast> function_name non_empty_member_modifiers
286286%type <ast> property_hook property_hook_list optional_property_hook_list hooked_property property_hook_body
287287%type <ast> optional_parameter_list
288+ %type <ast> interface_name_list interface_name
288289
289290%type <num> returns_ref function fn is_reference is_variadic property_modifiers property_hook_modifiers
290291%type <num> method_modifiers class_const_modifiers member_modifier optional_cpp_modifiers
@@ -355,10 +356,10 @@ legacy_namespace_name:
355356;
356357
357358name :
358- T_STRING { $$ = $1 ; $$ ->attr = ZEND_NAME_NOT_FQ; }
359- | T_NAME_QUALIFIED { $$ = $1 ; $$ ->attr = ZEND_NAME_NOT_FQ; }
360- | T_NAME_FULLY_QUALIFIED { $$ = $1 ; $$ ->attr = ZEND_NAME_FQ; }
361- | T_NAME_RELATIVE { $$ = $1 ; $$ ->attr = ZEND_NAME_RELATIVE; }
359+ T_STRING { $$ = $1 ; $$ ->attr | = ZEND_NAME_NOT_FQ; }
360+ | T_NAME_QUALIFIED { $$ = $1 ; $$ ->attr | = ZEND_NAME_NOT_FQ; }
361+ | T_NAME_FULLY_QUALIFIED { $$ = $1 ; $$ ->attr | = ZEND_NAME_FQ; }
362+ | T_NAME_RELATIVE { $$ = $1 ; $$ ->attr | = ZEND_NAME_RELATIVE; }
362363;
363364
364365attribute_decl :
@@ -666,12 +667,12 @@ extends_from:
666667
667668interface_extends_list :
668669 %empty { $$ = NULL ; }
669- | T_EXTENDS class_name_list { $$ = $2 ; }
670+ | T_EXTENDS interface_name_list { $$ = $2 ; }
670671;
671672
672673implements_list :
673674 %empty { $$ = NULL ; }
674- | T_IMPLEMENTS class_name_list { $$ = $2 ; }
675+ | T_IMPLEMENTS interface_name_list { $$ = $2 ; }
675676;
676677
677678foreach_variable :
@@ -974,6 +975,11 @@ class_name_list:
974975 | class_name_list ' ,' class_name { $$ = zend_ast_list_add($1 , $3 ); }
975976;
976977
978+ interface_name_list :
979+ interface_name { $$ = zend_ast_create_list(1 , ZEND_AST_NAME_LIST, $1 ); }
980+ | interface_name_list ' ,' interface_name { $$ = zend_ast_list_add($1 , $3 ); }
981+ ;
982+
977983trait_adaptations :
978984 ' ;' { $$ = NULL ; }
979985 | ' {' ' }' { $$ = NULL ; }
@@ -1411,6 +1417,11 @@ class_name:
14111417 | name { $$ = $1 ; }
14121418;
14131419
1420+ interface_name :
1421+ class_name { $$ = $1 ; }
1422+ | ' ?' name { $$ = $2 ; $$ ->attr |= ZEND_CLASS_NAME_OPTIONAL; }
1423+ ;
1424+
14141425class_name_reference :
14151426 class_name { $$ = $1 ; }
14161427 | new_variable { $$ = $1 ; }
0 commit comments