following example should have no errors, because is_resource() returns false on CLOSED resource and can be used for validation if given resource is open or closed:
https://phpstan.org/r/af634a66-2dc6-4226-9f63-0efaca69ad01
is_resouce() behavior: https://3v4l.org/sWd0q