diff --git a/src/Psalm/Internal/Stubs/CoreGenericFunctions.phpstub b/src/Psalm/Internal/Stubs/CoreGenericFunctions.phpstub index e236efd91..538138cf1 100644 --- a/src/Psalm/Internal/Stubs/CoreGenericFunctions.phpstub +++ b/src/Psalm/Internal/Stubs/CoreGenericFunctions.phpstub @@ -642,7 +642,29 @@ function preg_replace_callback($search, $replace, $subject, int $limit = -1, &$c * @param string $subject * @param mixed $matches * @param TFlags $flags - * @param-out (TFlags is 256 ? list> : list>) $matches + * @param-out ( + * TFlags is 1 + ? array> + : (TFlags is 2 + ? list> + : (TFlags is 256|257 + ? array> + : (TFlags is 258 + ? list> + : (TFlags is 512|513 + ? array> + : (TFlags is 514 + ? list> + : (TFlags is 770 + ? list> + : array + ) + ) + ) + ) + ) + ) + * ) $matches * @return int */ function preg_match_all($pattern, $replace, &$matches, int $flags = 1) {} diff --git a/tests/FunctionCallTest.php b/tests/FunctionCallTest.php index eefa0959a..b72c3c0fc 100644 --- a/tests/FunctionCallTest.php +++ b/tests/FunctionCallTest.php @@ -1327,7 +1327,7 @@ class FunctionCallTest extends TestCase /** * @psalm-pure * - * @return list> + * @return array> */ function extractUsernames(string $input): array { preg_match_all(\'/@[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}(?!\w)/\', $input, $matches);