diff --git a/stubs/core.stub b/stubs/core.stub index 0c6c6236d7..2cb6f29448 100644 --- a/stubs/core.stub +++ b/stubs/core.stub @@ -193,7 +193,7 @@ function sscanf(string $string, string $format, &$war, &...$vars) {} * ? list> * : (TFlags is 770 * ? list> - * : array + * : (TFlags is 0 ? array> : array) * ) * ) * ) diff --git a/tests/PHPStan/Analyser/data/param-out-default.php b/tests/PHPStan/Analyser/data/param-out-default.php index ca2770618e..5d83d593a2 100644 --- a/tests/PHPStan/Analyser/data/param-out-default.php +++ b/tests/PHPStan/Analyser/data/param-out-default.php @@ -27,4 +27,10 @@ public function doBar(): void assertType('array', $c); } + public function sayHello(string $row): void + { + preg_match_all('#// error:(.+)#', $row, $matches); + assertType('array>', $matches); + } + }