Bug report
I have some code similar to this:
$return = match (true) {
count($array) > 1 => $array[1],
default => $array[0] ?? 'empty',
};
Phpstan reports an offset error on $array[0].
Code snippet that reproduces the problem
https://phpstan.org/r/3f2b24c5-b3b3-4dcb-b46c-685973482e53
Expected output
No errors should be given I think.
Did PHPStan help you today? Did it make you happy in any way?
Phpstan really helps us maintaining our code quality to a reasonable level, thanks a lot!