diff --git a/src/Type/Php/MbStrlenFunctionReturnTypeExtension.php b/src/Type/Php/MbStrlenFunctionReturnTypeExtension.php index 141e21ff7f..7614786dbf 100644 --- a/src/Type/Php/MbStrlenFunctionReturnTypeExtension.php +++ b/src/Type/Php/MbStrlenFunctionReturnTypeExtension.php @@ -146,7 +146,7 @@ public function getTypeFromFunctionCall( } if (!$this->phpVersion->throwsOnInvalidMbStringEncoding() && in_array(self::UNSUPPORTED_ENCODING, $encodings, true)) { - return new UnionType([$range, new ConstantBooleanType(false)]); + return TypeCombinator::union($range, new ConstantBooleanType(false)); } return $range; }