Bug report
First bad commit phpstan/phpstan-src@52704a4 (PR phpstan/phpstan-src#5386)
The problem is that although $c is defined in an if branch, PHPStan thinks it's never defined on the left side of ?? later in the code.
Code snippet that reproduces the problem
https://phpstan.org/r/1f5824ce-c5b0-4c15-9416-9ed56a2640f4
Expected output
$c might be defined so $c ?? null should not report an error
Did PHPStan help you today? Did it make you happy in any way?
No response
Bug report
First bad commit phpstan/phpstan-src@52704a4 (PR phpstan/phpstan-src#5386)
The problem is that although
$cis defined in anifbranch, PHPStan thinks it's never defined on the left side of??later in the code.Code snippet that reproduces the problem
https://phpstan.org/r/1f5824ce-c5b0-4c15-9416-9ed56a2640f4
Expected output
$cmight be defined so$c ?? nullshould not report an errorDid PHPStan help you today? Did it make you happy in any way?
No response