Skip to content

Key preg_match_all() pattern-order lists by int<0, max> - #7218

Merged
ondrejmirtes merged 1 commit into
2.3.xfrom
list-key-preg-match-all
Nov 27, 2026
Merged

ondrejmirtes merged 1 commit into
2.3.xfrom
list-key-preg-match-all

Conversation

@ondrejmirtes

Copy link
Copy Markdown
Member

RegexArrayShapeMatcher built the PREG_PATTERN_ORDER match list as a raw IntersectionType of an int-keyed array and AccessoryArrayListType, which is not normalized. Since 88ab64d the union rules leave single arrays as they are, so this type printed as list<string> but was not accepted by list<string> (hit in shopware/shopware). The key is now int<0, max>, like the other lists the matcher builds.

Closes phpstan/phpstan#15856

RegexArrayShapeMatcher built the list of PREG_PATTERN_ORDER matches as an
IntersectionType of an int-keyed array and AccessoryArrayListType, which is
not normalized. It used to be normalized by the union rules, but since
single arrays are left as they are there, list<string> did not accept it.

Amp-Thread-ID: https://ampcode.com/threads/T-01a21c4a-ca6e-7246-a572-578487f178c3
@ondrejmirtes
ondrejmirtes merged commit 7279769 into 2.3.x Nov 27, 2026
1129 of 1169 checks passed
@ondrejmirtes
ondrejmirtes deleted the list-key-preg-match-all branch November 27, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

preg_match_all() list not accepted by list<string> (since phpstan-src 88ab64dc4, #7195)

1 participant