You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression: regex matches after checking non-empty array #14270
This is a duplicate of #11602 in which we thought the issue was solved but it's just it that every might not exist on non-empty-list error (even if it was a false positive or a real error) was not reported.
This was the section
https://github.com/phpstan/phpstan/issues/11602: this was supposed to be fixed by https://github.com/phpstan/phpstan-src/pull/3899 but wasn't: the array shape was transformed into an intersection list&array shape, that's why the error wasn't reported anymore. (cc @staabm)
=> A way to see this is the fact it's reported with reportPossiblyNonexistentConstantArrayOffset [phpstan.org/r/42af1687-c88d-4369-8c0b-7d3d1a14fcaa](https://phpstan.org/r/42af1687-c88d-4369-8c0b-7d3d1a14fcaa)
Activity
ondrejmirtes commentedon Mar 12, 2026
Regression in 5b79cca6d4186fb25d807adb9ca80b84664f7ec2
VincentLanglet commentedon Mar 12, 2026
Hi,
This is not really a regression.
This is a duplicate of #11602 in which we thought the issue was solved but it's just it that every
might not exist on non-empty-listerror (even if it was a false positive or a real error) was not reported.This was the section
Currently a workaround is https://phpstan.org/r/3d5430ba-5821-4df1-b007-ad4094919527
Fix regression in offset access check on non-empty narrowed arrays
Fix preg_match type inference: return union of empty and matched types
Fix phpstan/phpstan#14270: Regression: regex matches after checking n…
phpstan-bot commentedon Mar 12, 2026
Closed via merging phpstan/phpstan-src#5209
Updated PHPStan to commit 024a65c3146a554e0d872f19fe07acb5e6ab2a29
Updated PHPStan to commit 8d36b11ec59027617a44b0171cadc9b20f727b91
Fix phpstan/phpstan#14270: Regression: regex matches after checking n…
github-actions commentedon Apr 13, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.