Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/PHPStan/Analyser/AnalyserIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1504,6 +1504,12 @@ public function testBug12214(): void
$this->assertNoErrors($errors);
}

public function testBug11598(): void
{
$errors = $this->runAnalyse(__DIR__ . '/data/bug-11598.php');
$this->assertNoErrors($errors);
}

public function testBug11640(): void
{
$errors = $this->runAnalyse(__DIR__ . '/data/bug-11640.php');
Expand Down
16 changes: 16 additions & 0 deletions tests/PHPStan/Analyser/data/bug-11598.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php declare(strict_types=1);

namespace Bug11598;

use function unserialize;

function(): void {
[ // @phpstan-ignore offsetAccess.nonArray
'bar' => $foo,
] = '';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the original code rhs was unserialize(''), but it requires level 9 (checkExplicitMixed: true) while AnalyserIntegrationTest runs analysis with level 8.
So the code is modified to make rhs not mixed.


// @phpstan-ignore offsetAccess.nonArray
[
'bar' => $foo,
] = '';
};
Loading