Skip to content

Commit 5d3895d

Browse files
committed
more tests
1 parent aa007c0 commit 5d3895d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/PHPStan/Analyser/nsrt/preg_match_shapes.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,3 +762,9 @@ function bug11604 (string $string): void {
762762
assertType("array{0: string, 1?: ''|'XX', 2?: 'YY'}", $matches);
763763
// could be array{string, '', 'YY'}|array{string, 'XX'}|array{string}
764764
}
765+
766+
function bug11604b (string $string): void {
767+
if (preg_match('/(XX)|(YY)?(ZZ)/', $string, $matches)) {
768+
assertType("array{0: string, 1?: ''|'XX', 2?: ''|'YY', 3?: 'ZZ'}", $matches);
769+
}
770+
}

0 commit comments

Comments
 (0)