Skip to content

Commit 57a6087

Browse files
committed
fix conflict
1 parent 64ab476 commit 57a6087

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/PHPStan/Analyser/nsrt/preg_match_shapes.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,26 @@ function bug11291(string $s): void {
365365
assertType('array{}|array{0: string, 1: string, 2?: string, 3?: string}', $matches);
366366
}
367367

368+
function bug11323a(string $s): void
369+
{
370+
if (preg_match('/Price: (?P<currency>£|€)\d+/', $s, $matches)) {
371+
assertType('array{0: string, currency: string, 1: string}', $matches);
372+
} else {
373+
assertType('array{}', $matches);
374+
}
375+
assertType('array{}|array{0: string, currency: string, 1: string}', $matches);
376+
}
377+
378+
function bug11323b(string $s): void
379+
{
380+
if (preg_match('/Price: (?<currency>£|€)\d+/', $s, $matches)) {
381+
assertType('array{0: string, currency: string, 1: string}', $matches);
382+
} else {
383+
assertType('array{}', $matches);
384+
}
385+
assertType('array{}|array{0: string, currency: string, 1: string}', $matches);
386+
}
387+
368388
function unmatchedAsNullWithMandatoryGroup(string $s): void {
369389
if (preg_match('/Price: (?<currency>£|€)\d+/', $s, $matches, PREG_UNMATCHED_AS_NULL)) {
370390
assertType('array{0: string, currency: string, 1: string}', $matches);

0 commit comments

Comments
 (0)