Commit e2d4e60
Treat legacy-null and sealed-marker as equal in
`equals()` already documented that a null unsealed slot (legacy /
pre-bleeding-edge, `isUnsealed()` = `Maybe`) and the
`[NeverType, NeverType]` sealed marker (bleeding edge, `isUnsealed()`
= `No`) both mean "no real extras" and should compare equal. But the
implementation used `isUnsealed()->no()`, which is `false` for the
null case and `true` for the marker — so a legacy-null shape and a
marker-sealed shape of otherwise-identical structure compared
*unequal*.
This surfaced as `TypeToPhpDocNodeTest::testToPhpDocNode` failing only
under old PHPUnit (PHP < 8.2): there the data provider runs before the
test container enables bleeding edge, so the directly-constructed
expected type gets a null slot while the round-trip-parsed type
(built after bleeding edge is on) gets the marker. New PHPUnit runs
data providers after container init, so both sides got the marker and
the bug stayed hidden.
Compare on `isUnsealed()->yes()` ("has real extras") instead, so null
and marker are both treated as sealed and only genuine extras are
compared. Added a timing-independent unit test that constructs both
forms directly via `BleedingEdgeToggle`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>ConstantArrayType::equals()
1 parent e40cef4 commit e2d4e60
2 files changed
Lines changed: 38 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
903 | 903 | | |
904 | 904 | | |
905 | 905 | | |
906 | | - | |
907 | | - | |
908 | | - | |
909 | | - | |
910 | | - | |
911 | | - | |
912 | | - | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
913 | 917 | | |
914 | 918 | | |
915 | 919 | | |
916 | | - | |
| 920 | + | |
917 | 921 | | |
918 | 922 | | |
919 | 923 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1549 | 1549 | | |
1550 | 1550 | | |
1551 | 1551 | | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
1552 | 1578 | | |
1553 | 1579 | | |
1554 | 1580 | | |
| |||
0 commit comments