From c1ab43d1b83d4c5c90b1e18e7acf546a3860f448 Mon Sep 17 00:00:00 2001 From: Mark Reidenbach Date: Wed, 14 Aug 2024 16:05:13 -0500 Subject: [PATCH] Handle the ::class static keyword as a special case. --- src/parser/variable.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/parser/variable.js b/src/parser/variable.js index 2a2f2b9ec..438214ede 100644 --- a/src/parser/variable.js +++ b/src/parser/variable.js @@ -216,8 +216,15 @@ module.exports = { this.error(); } + // Handle special "::class" static keyword + let classKeyword = null; + if (this.peek() === this.tok.T_CLASS) { + this.next(); + classKeyword = this.node("identifier")(this.text()); + this.next(); + } node = this.node("staticlookup"); - result = node(result, this.read_what(true)); + result = node(result, classKeyword ?? this.read_what(true)); // fix 185 // static lookup dereferencables are limited to staticlookup over functions