Skip to content

Commit 1cd1f80

Browse files
committed
add test
1 parent 548f4f6 commit 1cd1f80

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

tests/PHPStan/Rules/Variables/NullCoalesceRuleTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,4 +362,9 @@ public function testBug14213(): void
362362
]);
363363
}
364364

365+
public function testBug13921(): void
366+
{
367+
$this->analyse([__DIR__ . '/data/bug-13921.php'], []);
368+
}
369+
365370
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
namespace Bug13921;
4+
5+
/** @param list<array<?string>> $x */
6+
function foo(array $x): void {
7+
var_dump($x[0]['bar'] ?? null);
8+
var_dump($x[0] ?? null);
9+
}

0 commit comments

Comments
 (0)