Skip to content

Commit f46fe27

Browse files
takaramondrejmirtes
authored andcommitted
Add regression test
Closes phpstan/phpstan#11598
1 parent fe80263 commit f46fe27

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

tests/PHPStan/Analyser/AnalyserIntegrationTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,6 +1504,12 @@ public function testBug12214(): void
15041504
$this->assertNoErrors($errors);
15051505
}
15061506

1507+
public function testBug11598(): void
1508+
{
1509+
$errors = $this->runAnalyse(__DIR__ . '/data/bug-11598.php');
1510+
$this->assertNoErrors($errors);
1511+
}
1512+
15071513
public function testBug11640(): void
15081514
{
15091515
$errors = $this->runAnalyse(__DIR__ . '/data/bug-11640.php');
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace Bug11598;
4+
5+
use function unserialize;
6+
7+
function(): void {
8+
[ // @phpstan-ignore offsetAccess.nonArray
9+
'bar' => $foo,
10+
] = '';
11+
12+
// @phpstan-ignore offsetAccess.nonArray
13+
[
14+
'bar' => $foo,
15+
] = '';
16+
};

0 commit comments

Comments
 (0)