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 @@ -981,6 +981,12 @@ public function testArrayUnion(): void
$this->assertNoErrors($errors);
}

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

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

namespace Bug6948;

$row = [1];
if (rand()) {
$row[] = $row;
}
if (rand()) {
$row[] = $row;
}
if (rand()) {
$row[] = $row;
}

if (rand()) {
$row[] = $row;
}
if (rand()) {
$row[] = $row;
}
if (rand()) {
$row[] = $row;
}

if (rand()) {
$row[] = $row;
}
if (rand()) {
$row[] = $row;
}
if (rand()) {
$row[] = $row;
}

if (rand()) {
$row[] = $row;
}
if (rand()) {
$row[] = $row;
}
if (rand()) {
$row[] = $row;
}

if (rand()) {
$row[] = $row;
}
if (rand()) {
$row[] = $row;
}
if (rand()) {
$row[] = $row;
}

if (rand()) {
$row[] = $row;
}
if (rand()) {
$row[] = $row;
}
if (rand()) {
$row[] = $row;
}
Loading