diff --git a/src/Psalm/Type.php b/src/Psalm/Type.php index 1215799f785..d05a9b9d5c3 100644 --- a/src/Psalm/Type.php +++ b/src/Psalm/Type.php @@ -287,7 +287,7 @@ public static function getAtomicStringFromLiteral(string $value, bool $from_docb $type = $config->eventDispatcher->dispatchStringInterpreter($event); if (!$type) { - if (strlen($value) < $config->max_string_length) { + if ($value === '' || strlen($value) < $config->max_string_length) { $type = new TLiteralString($value, $from_docblock); } else { $type = new TNonEmptyString($from_docblock);