Bug report
Hello there. While adding some types and types' tests for a bunch of Functional-related functions in our codebase, I noticed some weird behavior.
I have two functions :
find(array $array, mixed $value): mixed (|null being implied)
findKey(array $array, int|string $key): int|string|null
The implementation is strictly the same (as far as PHP code is concerned), yet the produced types are wildly different. I guess it's because of array-key and how it is processed ?
(I don't currently have the time to work on an implementation, but maybe someone will.)
Code snippet that reproduces the problem
https://phpstan.org/r/d979d850-c552-4598-bb72-50ee7cf7d4eb
Expected output
The above code sample should produce the expected types.
Did PHPStan help you today? Did it make you happy in any way?
(I have a bunch of small issues to create, sorry if I don't come up with something new for each of them 🙏 )