Bug report
This seems like a regression from 1.5.3, we didn't have this issue before.
$whereParts = [];
if (!$foo['a']) {
$whereParts[] = 'something';
}
if (!$foo['b']) {
$count = 3;
$whereParts[] = 'example';
}
if (empty($whereParts)) {
return [];
}
return isset($count) ? $count : 0;
$count is marked as always defined, it can clearly be unset.
Code snippet that reproduces the problem
https://phpstan.org/r/81e9327a-136e-4a7f-908e-b571c173d32c
Expected output
No error
Did PHPStan help you today? Did it make you happy in any way?
80% of the time, it does all the time!