diff --git a/src/Psalm/Checker/StatementsChecker.php b/src/Psalm/Checker/StatementsChecker.php
index <HASH>..<HASH> 100644
--- a/src/Psalm/Checker/StatementsChecker.php
+++ b/src/Psalm/Checker/StatementsChecker.php
@@ -1795,7 +1795,7 @@ class StatementsChecker
                 // Hack has a similar issue: https://github.com/facebook/hhvm/issues/5164
                 if ($lhs_type_part->isObject() || in_array(strtolower($lhs_type_part->value), ['stdclass', 'simplexmlelement', 'dateinterval', 'domdocument', 'domnode'])) {
                     $context->vars_in_scope[$var_id] = Type::getMixed();
-                    continue;
+                    return;
                 }
 
                 if (self::isMock($lhs_type_part->value)) {
Exit properly when encountering classes we cannot deal with