diff --git a/src/Type/Php/RangeFunctionReturnTypeExtension.php b/src/Type/Php/RangeFunctionReturnTypeExtension.php index de6e43bd79..45bc460aa1 100644 --- a/src/Type/Php/RangeFunctionReturnTypeExtension.php +++ b/src/Type/Php/RangeFunctionReturnTypeExtension.php @@ -93,7 +93,7 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection, } return TypeCombinator::intersect( new ArrayType( - new IntegerType(), + IntegerRangeType::fromInterval(0, (int) (($endConstant->getValue() - $startConstant->getValue()) / $stepConstant->getValue())), IntegerRangeType::fromInterval($startConstant->getValue(), $endConstant->getValue()), ), new NonEmptyArrayType(),