Replies: 2 comments
-
named arguments result in an array-key of string: you can remove the |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks for the quick explanation! It was new to me that named arguments affect the keys! Thank you! 👍 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have questions using the variable-length argument list. My code looks like that:
And from my understanding, the
$pices
is from typearray<int, string>
.PHPStan confirms that for PHP 7.x but not for PHP 8.x. Instead, the type would be
array<int|string, string>
. What has changed between PHP 7 and 8? And is there really a possibility to have keys from typestring
in the example above?The example in the playground: https://phpstan.org/r/3a58773b-e4b6-49b4-9087-e66e76c2bb2e
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions