Skip to content

Fix preg_match named capturing groups#3228

Merged
ondrejmirtes merged 1 commit intophpstan:1.11.xfrom
staabm:bug11323
Jul 12, 2024
Merged

Fix preg_match named capturing groups#3228
ondrejmirtes merged 1 commit intophpstan:1.11.xfrom
staabm:bug11323

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 <2228672+mvorisek@users.noreply.github.com>
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
@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