Skip to content

Commit a856ec7

Browse files
committed
Fix preg_match_all behaviour with no flags
1 parent 491a724 commit a856ec7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

stubs/core.stub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ function sscanf(string $string, string $format, &$war, &...$vars) {}
193193
* ? list<array<?string>>
194194
* : (TFlags is 770
195195
* ? list<array<array{?string, int}>>
196-
* : array<mixed>
196+
* : (TFlags is 0 ? array<list<string>> : array<mixed>)
197197
* )
198198
* )
199199
* )

tests/PHPStan/Analyser/data/param-out-default.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,10 @@ public function doBar(): void
2727
assertType('array<int>', $c);
2828
}
2929

30+
public function sayHello(string $row): void
31+
{
32+
preg_match_all('#// error:(.+)#', $row, $matches);
33+
assertType('array<list<string>>', $matches);
34+
}
35+
3036
}

0 commit comments

Comments
 (0)