From 0e614b0c14616493390600d7917f1e89f3238ae3 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 19 Aug 2024 21:38:15 +0200 Subject: [PATCH] Add failing test for matchAllStrictGroups --- tests/PHPStanTests/nsrt/preg-match.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/PHPStanTests/nsrt/preg-match.php b/tests/PHPStanTests/nsrt/preg-match.php index c71875f..38957c7 100644 --- a/tests/PHPStanTests/nsrt/preg-match.php +++ b/tests/PHPStanTests/nsrt/preg-match.php @@ -110,6 +110,10 @@ function doMatchAllStrictGroups(string $s): void assertType('array{}', $matches); } assertType('array{}|array{0: list, test: list, 1: list}', $matches); + + if (Preg::isMatchAllStrictGroups('/Price: (?£|€)?\d+/', $s, $matches)) { + assertType('array{0: list, test: list, 1: list}', $matches); + } } // disabled until https://github.com/phpstan/phpstan-src/pull/3185 can be resolved