Skip to content

Commit 3779ce7

Browse files
committed
Added regression test
1 parent 692909b commit 3779ce7

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

tests/PHPStan/Analyser/AnalyserIntegrationTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,6 +1507,12 @@ public function testBug13279(): void
15071507
$this->assertSame('Parameter #2 $offset of function array_splice expects int, string given.', $errors[0]->getMessage());
15081508
}
15091509

1510+
public function testBug13310(): void
1511+
{
1512+
$errors = $this->runAnalyse(__DIR__ . '/data/bug-13310.php');
1513+
$this->assertNoErrors($errors);
1514+
}
1515+
15101516
/**
15111517
* @param string[]|null $allAnalysedFiles
15121518
* @return Error[]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace Bug13310;
4+
5+
function get_array(): array
6+
{
7+
return [];
8+
}
9+
10+
$tests = get_array();
11+
12+
foreach ($tests as $test) {
13+
14+
// information fichiers
15+
$test['information'] = '';
16+
$test['information'] .= $test['a'] ? 'test' : '';
17+
$test['information'] .= $test['b'] ? 'test' : '';
18+
$test['information'] .= $test['c'] ? 'test' : '';
19+
$test['information'] .= $test['d'] ? 'test' : '';
20+
$test['information'] .= $test['e'] ? 'test' : '';
21+
$test['information'] .= $test['f'] ? 'test' : '';
22+
$test['information'] .= $test['g'] ? 'test' : '';
23+
$test['information'] .= $test['h'] ? 'test' : '';
24+
25+
}

0 commit comments

Comments
 (0)