Repository navigation
Commit f62737f
Keep a list's growth range at PHP_INT_MAX in IntersectionType::setOffsetValueType()
When setting an offset on a list turns the result into a non-list,
IntersectionType::setOffsetValueType() keeps the list accessory if the
offset lies in int<0, N + 1> for a known offset N of the list. With N =
PHP_INT_MAX, `N + 1` became a float and IntegerRangeType::fromInterval()
threw a TypeError; the native port computed it in signed arithmetic,
which overflowed. No offset exists past PHP_INT_MAX, so the range is now
open-ended there (int<0, max>) in the twin and the port alike.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Fdg8n3eEi4ZoXa4dA2k4A1 parent 4dea335 commit f62737f
4 files changed
Lines changed: 27 additions & 2 deletions
File tree
- src/Type
- tests/PHPStan/Type
- turbo-ext
- src
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
1169 | 1170 | | |
1170 | 1171 | | |
1171 | 1172 | | |
1172 | | - | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
1173 | 1176 | | |
1174 | 1177 | | |
1175 | 1178 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
1016 | 1017 | | |
1017 | 1018 | | |
1018 | 1019 | | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
1019 | 1033 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1634 | 1634 | | |
1635 | 1635 | | |
1636 | 1636 | | |
1637 | | - | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
1638 | 1640 | | |
1639 | 1641 | | |
1640 | 1642 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8420 | 8420 | | |
8421 | 8421 | | |
8422 | 8422 | | |
| 8423 | + | |
| 8424 | + | |
| 8425 | + | |
| 8426 | + | |
| 8427 | + | |
| 8428 | + | |
8423 | 8429 | | |
8424 | 8430 | | |
8425 | 8431 | | |
| |||
0 commit comments