Skip to content

Commit bcd8a54

Browse files
committed
Create bug-13088.php
1 parent 5ec8af7 commit bcd8a54

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php // lint >= 8.0
2+
3+
namespace Bug13088;
4+
5+
use function PHPStan\dumpType;
6+
use function PHPStan\Testing\assertType;
7+
8+
class HelloWorld
9+
{
10+
public function sayHello(string $s, int $offset): void
11+
{
12+
if (preg_match('~msgstr "(.*)"\n~', $s, $matches, 0, $offset) === 1) {
13+
assertType('array{non-falsy-string, string}', $matches);
14+
}
15+
}
16+
17+
public function sayHello2(string $s, int $offset): void
18+
{
19+
if (preg_match('~msgstr "(.*)"\n~', $s, $matches, offset: $offset) === 1) {
20+
assertType('array{non-falsy-string, string}', $matches);
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)