Skip to content

preg_match: non-empty-string for $match[0] #12749

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gharlan opened this issue Mar 17, 2025 · 1 comment · Fixed by phpstan/phpstan-src#3897
Closed

preg_match: non-empty-string for $match[0] #12749

gharlan opened this issue Mar 17, 2025 · 1 comment · Fixed by phpstan/phpstan-src#3897

Comments

@gharlan
Copy link

gharlan commented Mar 17, 2025

Feature request

https://phpstan.org/r/c7ea9c80-2acb-49f2-90b9-46dafb4e5db9
It would be nice if the type of $match could be narrowed down to array{non-empty-string} in that case.

Note that it works as expected when using a capturing group: https://phpstan.org/r/1128b5ab-20ae-4948-871f-682c58b664a2

Did PHPStan help you today? Did it make you happy in any way?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants