Skip to content

Commit

Permalink
Add failing test for matchAllStrictGroups
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Aug 23, 2024
1 parent 9bed2ae commit 0e614b0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/PHPStanTests/nsrt/preg-match.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ function doMatchAllStrictGroups(string $s): void
assertType('array{}', $matches);
}
assertType('array{}|array{0: list<string>, test: list<non-empty-string>, 1: list<non-empty-string>}', $matches);

if (Preg::isMatchAllStrictGroups('/Price: (?<test>£|€)?\d+/', $s, $matches)) {
assertType('array{0: list<string>, test: list<non-empty-string>, 1: list<non-empty-string>}', $matches);
}
}

// disabled until https://github.com/phpstan/phpstan-src/pull/3185 can be resolved
Expand Down

0 comments on commit 0e614b0

Please sign in to comment.