From 6469f22054fe7bb62ead451e5cf5ce127bb91172 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Fri, 19 Dec 2025 17:38:28 +0100 Subject: [PATCH] Prevent unnecessary scope merging --- src/Analyser/MutatingScope.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Analyser/MutatingScope.php b/src/Analyser/MutatingScope.php index 5a07151b15..6a88cb308d 100644 --- a/src/Analyser/MutatingScope.php +++ b/src/Analyser/MutatingScope.php @@ -4816,7 +4816,7 @@ public function isInFirstLevelStatement(): bool public function mergeWith(?self $otherScope): self { - if ($otherScope === null) { + if ($otherScope === null || $this === $otherScope) { return $this; } $ourExpressionTypes = $this->expressionTypes;