diff --git a/src/Psalm/Internal/Type/TypeCombiner.php b/src/Psalm/Internal/Type/TypeCombiner.php index 6d25b1f40c2..bc25398c72c 100644 --- a/src/Psalm/Internal/Type/TypeCombiner.php +++ b/src/Psalm/Internal/Type/TypeCombiner.php @@ -1167,7 +1167,8 @@ private static function scrapeIntProperties( } if ($type instanceof TLiteralInt) { - if ($combination->ints !== null && count($combination->ints) < $literal_limit) { + $combination->ints ??= []; + if (count($combination->ints) < $literal_limit) { $combination->ints[$type_key] = $type; } else { $combination->ints[$type_key] = $type;