Bug report
It raises an error on $test->test(); saying that $test could be null.
Fairly easy to workaround but thought it was a curious case
Code snippet that reproduces the problem
https://phpstan.org/r/d3e1bc0e-ee7f-4f9e-9a9c-733d51dad43e
Expected output
No errors - $test to be not nullable at the point it has method called, regardless of the else condition or not
Did PHPStan help you today? Did it make you happy in any way?
PHPStan probably saves me hours every day :smile
Bug report
It raises an error on
$test->test();saying that$testcould be null.Fairly easy to workaround but thought it was a curious case
Code snippet that reproduces the problem
https://phpstan.org/r/d3e1bc0e-ee7f-4f9e-9a9c-733d51dad43e
Expected output
No errors -
$testto be not nullable at the point it has method called, regardless of the else condition or notDid PHPStan help you today? Did it make you happy in any way?
PHPStan probably saves me hours every day :smile