Skip to content

Commit 9abe059

Browse files
zonuexeclaude
andcommitted
Correct two comments of the range() return type extension
A numeric string keeps its value in the float path before PHP 8.3, and without the returned items a string boundary is generalized rather than following PHP 8.3. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 5483304 commit 9abe059

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎src/Type/Php/RangeFunctionReturnTypeExtension.php‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ private static function getLongRangeType(
252252
}
253253

254254
// before PHP 8.3 a float argument produced floats even when none of the arguments had a fractional
255-
// part, and even for two strings, which then counted as 0
255+
// part, and even for two strings, of which only a numeric one kept its value
256256
$floatListType = self::getNonEmptyListOfType(new FloatType());
257257
if ($hasStricterRange->no()) {
258258
return $floatListType;
@@ -262,7 +262,8 @@ private static function getLongRangeType(
262262
}
263263

264264
/**
265-
* The type of the items the runtime returned, or without them what PHP 8.3 returns.
265+
* The type of the items the runtime returned. Without them it follows PHP 8.3 for numeric
266+
* boundaries and generalizes the arguments for a string one.
266267
*
267268
* @param non-empty-list<int|float|string>|null $rangeValues
268269
*/

0 commit comments

Comments
 (0)