psalm
psalm copied to clipboard
PHP variadic internal functions should not allow named calls
https://psalm.dev/r/14572dea00
This is a fatal error.
The reason it's wrong in psalm is that PHP's docs itself have been wrong all along (since the beginning), which is why this is wrong in psalm too I guess - see https://github.com/php/doc-en/issues/3233
I found these snippets:
https://psalm.dev/r/14572dea00
<?php
/**
* @var array $a
* @var array $b
* @var array $c
*/
$x = array_intersect(arrays: $a, array: $b);
$y = array_intersect(hello: $a, world: $c, array: $b);
Psalm output (using commit 3600d51):
INFO: UnusedVariable - 8:1 - $x is never referenced or the value is not used
INFO: UnusedVariable - 9:1 - $y is never referenced or the value is not used