From cb575b10faa25f33870e60941c53bc96638c2d49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Tue, 15 Apr 2025 09:41:04 +0200 Subject: [PATCH] Fix GH-18108 gen_stub: Using $this when not in object context --- build/gen_stub.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/gen_stub.php b/build/gen_stub.php index e69846733a9d9..d3ffc04c3f890 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -2174,7 +2174,7 @@ public function enterNode(Node $expr) static function (Expr $expr) use ($allConstInfos, &$isUnknownConstValue) { // $expr is a ConstFetch with a name of a C macro here if (!$expr instanceof Expr\ConstFetch) { - throw new Exception($this->getVariableTypeName() . " " . $this->name->__toString() . " has an unsupported value"); + throw new Exception("Expression at line " . $expr->getStartLine() . " must be a global, non-magic constant"); } $constName = $expr->name->__toString();