Skip to content

Commit 91494f0

Browse files
Add test
1 parent 94150ef commit 91494f0

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2174,6 +2174,11 @@ public function testBug10020(): void
21742174
$this->analyse([__DIR__ . '/data/bug-10020.php'], []);
21752175
}
21762176

2177+
public function testBug8506(): void
2178+
{
2179+
$this->analyse([__DIR__ . '/data/bug-8506.php'], []);
2180+
}
2181+
21772182
public function testBug13065(): void
21782183
{
21792184
$errors = [];
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace Bug8506;
4+
5+
function a(): ?int { return rand(0, 1) ? 1 : null; }
6+
function b(int $i, int ...$a): void {}
7+
8+
$arguments = array_filter([
9+
a(),
10+
a(),
11+
a(),
12+
]);
13+
14+
if (!$arguments) {
15+
return;
16+
}
17+
18+
b(...$arguments);

0 commit comments

Comments
 (0)