Bug report
Phpstan is incorrectly silent in case assignment happens before is_resource() check.
Code snippet provided is simplified, I ran into this issue when trying to migrate a project from PHP 5.x to PHP 8.x because pg functions (e.g. pg_connect) now return proper objects instead of resources.
Code snippet that reproduces the problem
https://phpstan.org/r/bfb2d1b2-c94a-4cf5-b339-9331f3ba11be
Expected output
A will always evaluate to false error regardless of previous assignment.