-
Notifications
You must be signed in to change notification settings - Fork 473
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
Fix preg_match named capturing groups #3228
Conversation
You've opened the pull request against the latest branch 1.12.x. If your code is relevant on 1.11.x and you want it to be released sooner, please rebase your pull request and change its target to 1.11.x. |
Co-Authored-By: Michael Voříšek <[email protected]>
function bug11323b(string $s): void | ||
{ | ||
if (preg_match('/Price: (?<currency>£|€)\d+/', $s, $matches)) { | ||
assertType('array{0: string, currency: string, 1: string}', $matches); | ||
} else { | ||
assertType('array{}', $matches); | ||
} | ||
assertType('array{}|array{0: string, currency: string, 1: string}', $matches); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test for phpstan/phpstan#11323 (comment)
This pull request has been marked as ready for review. |
LGTM, CI errors are unrelated. |
Thank you. |
refs phpstan/phpstan#11323
Fix by Michael Voříšek https://github.com/mvorisek/Hoa-Regex/commit/2cd9490df68fff675385b46fd990dee88f510bb9