Skip to content

Commit fb014ee

Browse files
committed
test yoda notation
1 parent 61c35ce commit fb014ee

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/PHPStan/Analyser/nsrt/bug-11293.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,15 @@ public function sayHello5(string $s): void
4848

4949
assertType('array{string, non-falsy-string&numeric-string}', $matches);
5050
}
51+
52+
public function sayHello6(string $s): void
53+
{
54+
if (1 > preg_match('/data-(\d{6})\.json$/', $s, $matches)) {
55+
assertType('array{}', $matches);
56+
57+
return;
58+
}
59+
60+
assertType('array{string, non-falsy-string&numeric-string}', $matches);
61+
}
5162
}

0 commit comments

Comments
 (0)