Skip to content

Commit d37ad89

Browse files
committed
Create bug-14083.php
1 parent a91aa68 commit d37ad89

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Bug14083;
6+
7+
use function PHPStan\Testing\assertType;
8+
9+
/**
10+
* @param list<string> $convert
11+
*/
12+
function example(array $convert): void {
13+
foreach ($convert as &$item) {
14+
$item = strtoupper($item);
15+
}
16+
assertType('list<string>', $convert);
17+
}
18+
19+
/**
20+
* @param list<string> $convert
21+
*/
22+
function example2(array $convert): void {
23+
foreach ($convert as $key => $item) {
24+
$convert[$key] = strtoupper($item);
25+
}
26+
assertType('list<uppercase-string>', $convert);
27+
}

0 commit comments

Comments
 (0)