Bug report
When using if (!isset($a['first_key']) && !isset($a['second_key'])) return;, phpstan refines first_key as not being optional in the array shape of $a after the early return
Code snippet that reproduces the problem
https://phpstan.org/r/292eadfe-27e6-4668-b7e5-ccc91c581290
Expected output
The array_key_exists call is not reported as useless by strict rules, because team_name can indeed be missing when reaching it.
Did PHPStan help you today? Did it make you happy in any way?
Bug report
When using
if (!isset($a['first_key']) && !isset($a['second_key'])) return;, phpstan refinesfirst_keyas not being optional in the array shape of$aafter the early returnCode snippet that reproduces the problem
https://phpstan.org/r/292eadfe-27e6-4668-b7e5-ccc91c581290
Expected output
The
array_key_existscall is not reported as useless by strict rules, becauseteam_namecan indeed be missing when reaching it.Did PHPStan help you today? Did it make you happy in any way?