diff --git a/stubs/core.stub b/stubs/core.stub index f608f51110..37168e972d 100644 --- a/stubs/core.stub +++ b/stubs/core.stub @@ -377,3 +377,12 @@ function register_tick_function(callable $callback, mixed ...$args): bool {} * @return resource|false */ function proc_open($command, array $descriptor_spec, &$pipes, ?string $cwd = null, ?array $env_vars = null, ?array $options = null) {} + +/** + * @param mixed &$hosts + * @param mixed &$weights + * + * @param-out list $hosts + * @param-out list $weights + */ +function getmxrr(string $hostname, &$hosts, &$weights = null): bool {} diff --git a/tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php b/tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php index 45692c1ea7..2494158ca7 100644 --- a/tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php +++ b/tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php @@ -2663,6 +2663,13 @@ public function testBug10612(): void $this->analyse([__DIR__ . '/data/bug-10612.php'], []); } + public function testBug10704(): void + { + $this->checkExplicitMixed = true; + $this->checkImplicitMixed = true; + $this->analyse([__DIR__ . '/data/bug-10704.php'], []); + } + #[RequiresPhp('>= 8.1')] public function testBug9652(): void { diff --git a/tests/PHPStan/Rules/Functions/data/bug-10704.php b/tests/PHPStan/Rules/Functions/data/bug-10704.php new file mode 100644 index 0000000000..a830e36da7 --- /dev/null +++ b/tests/PHPStan/Rules/Functions/data/bug-10704.php @@ -0,0 +1,8 @@ +