|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace Bug14596; |
| 4 | + |
| 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 |
| 14 | +\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