Skip to content

Commit

Permalink
Add test for nested array_map return type.
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrolGenhald committed Dec 15, 2021
1 parent 04c0243 commit 03ccb9b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/ReturnTypeTest.php
Expand Up @@ -1065,6 +1065,29 @@ public function __construct() {
}
}'
],
'nestedArrayMapReturnTypeDoesntCrash' => [
'<?php
function bar(array $a): array {
return $a;
}
/**
* @param array[] $x
*
* @return array[]
*/
function foo(array $x): array {
return array_map(
"array_merge",
array_map(
"bar",
$x
),
$x
);
}
',
],
];
}

Expand Down

0 comments on commit 03ccb9b

Please sign in to comment.