Attributes require a static class name...
This fixes https://oss-fuzz.com/testcase-detail/
6267052359942144.
--- /dev/null
+--TEST--
+Attribute name cannot be a variable
+--FILE--
+<?php
+
+<<$x>>
+class A {}
+
+?>
+--EXPECTF--
+Parse error: syntax error, unexpected '$x' (T_VARIABLE), expecting identifier (T_STRING) or static (T_STATIC) or namespace (T_NAMESPACE) or \\ (T_NS_SEPARATOR) in %s on line %d
;
attribute_decl:
- class_name_reference
+ class_name
{ $$ = zend_ast_create(ZEND_AST_ATTRIBUTE, $1, NULL); }
- | class_name_reference '(' ')'
+ | class_name '(' ')'
{ $$ = zend_ast_create(ZEND_AST_ATTRIBUTE, $1, NULL); }
- | class_name_reference '(' attribute_arguments ')'
+ | class_name '(' attribute_arguments ')'
{ $$ = zend_ast_create(ZEND_AST_ATTRIBUTE, $1, $3); }
;