Skip to content

Commit 87fb7f1

Browse files
phpstan-botclaude
andcommitted
Test all sorts of callables in bug-14596 integration test
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f6df338 commit 87fb7f1

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

tests/PHPStan/Analyser/data/bug-14596.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,33 @@
22

33
namespace Bug14596;
44

5+
function foo(int $a, int $b, int $c, string ...$rest): void {}
6+
7+
class Foo {
8+
public function bar(int $a, int $b, int $c, string ...$rest): void {}
9+
public static function baz(int $a, int $b, int $c, string ...$rest): void {}
10+
public function __construct(int $a, int $b, int $c, string ...$rest) {}
11+
}
12+
13+
// built-in function
514
\PHPStan\dumpType(1, 2, 3, d: 'foo', 5);
15+
16+
// user-defined function
17+
foo(1, 2, 3, d: 'foo', 5);
18+
19+
// method call
20+
$obj = new Foo(1, 2, 3);
21+
$obj->bar(1, 2, 3, d: 'foo', 5);
22+
23+
// static method call
24+
Foo::baz(1, 2, 3, d: 'foo', 5);
25+
26+
// constructor
27+
new Foo(1, 2, 3, d: 'foo', 5);
28+
29+
// closure
30+
$closure = function (int $a, int $b, int $c, string ...$rest): void {};
31+
$closure(1, 2, 3, d: 'foo', 5);
32+
33+
// call_user_func
34+
call_user_func('Bug14596\foo', 1, 2, 3, d: 'foo', 5);

0 commit comments

Comments
 (0)