Skip to content
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

Merged
merged 1 commit into from
Jul 12, 2024
Merged

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Jul 11, 2024

@phpstan-bot
Copy link
Collaborator

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]>
Comment on lines +377 to +385
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);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@staabm staabm marked this pull request as ready for review July 11, 2024 15:35
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@mvorisek
Copy link
Contributor

LGTM, CI errors are unrelated.

@ondrejmirtes ondrejmirtes merged commit 892eb2e into phpstan:1.11.x Jul 12, 2024
452 of 455 checks passed
@ondrejmirtes
Copy link
Member

Thank you.

@staabm staabm deleted the bug11323 branch July 12, 2024 11:30
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.

4 participants