diff --git a/grammar/zend_language_parser.phpy b/grammar/zend_language_parser.phpy index 404512e..14c6e46 100644 --- a/grammar/zend_language_parser.phpy +++ b/grammar/zend_language_parser.phpy @@ -678,7 +678,7 @@ function_call: ; class_name: - T_STATIC { $$ = Name['static']; } + T_STATIC { $$ = Name[$1]; } | name { $$ = $1; } ; diff --git a/lib/PhpParser/Parser.php b/lib/PhpParser/Parser.php index 416ca6e..f3cec5b 100644 --- a/lib/PhpParser/Parser.php +++ b/lib/PhpParser/Parser.php @@ -2167,7 +2167,7 @@ class Parser extends ParserAbstract } protected function reduceRule289($attributes) { - $this->semValue = new Node\Name('static', $attributes); + $this->semValue = new Node\Name($this->semStack[$this->stackPos-(1-1)], $attributes); } protected function reduceRule290($attributes) { diff --git a/test/PhpParser/NodeVisitor/NameResolverTest.php b/test/PhpParser/NodeVisitor/NameResolverTest.php index ec88238..b833591 100644 --- a/test/PhpParser/NodeVisitor/NameResolverTest.php +++ b/test/PhpParser/NodeVisitor/NameResolverTest.php @@ -343,6 +343,6 @@ EOC; $this->assertEquals('SELF', (string)$methodStmt->stmts[0]->class); $this->assertEquals('PARENT', (string)$methodStmt->stmts[1]->class); - $this->assertEquals('static', (string)$methodStmt->stmts[2]->class); + $this->assertEquals('STATIC', (string)$methodStmt->stmts[2]->class); } }