diff --git a/src/Analyser/ExpressionTypeHolder.php b/src/Analyser/ExpressionTypeHolder.php index bb598d8fb1..c904db8d7d 100644 --- a/src/Analyser/ExpressionTypeHolder.php +++ b/src/Analyser/ExpressionTypeHolder.php @@ -26,6 +26,10 @@ public static function createMaybe(Expr $expr, Type $type): self public function equals(self $other): bool { + if ($this === $other) { + return true; + } + if (!$this->certainty->equals($other->certainty)) { return false; }