Fix GH-18108 gen_stub: Using $this when not in object context

This commit is contained in:
Máté Kocsis 2025-04-15 09:41:04 +02:00 committed by Máté Kocsis
parent 76d7c616bb
commit 93a3256da8

View file

@ -2174,7 +2174,7 @@ class EvaluatedValue
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();