We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a91aa68 commit d37ad89Copy full SHA for d37ad89
1 file changed
tests/PHPStan/Analyser/nsrt/bug-14083.php
@@ -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
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