Skip to content

V2 false positive type error within is_resource conditional #12111

Closed
@bshaffer

Description

@bshaffer

Bug report

See the failing phpstan run

We are getting a type error within a union type because "resource" is not supported, even when the call is wrapped in if (!is_resource) { ... }.

This is a regression since v1

Code snippet that reproduces the problem

https://phpstan.org/r/73167be4-3cfc-43a8-8613-9041aa97a126

Expected output

The issue reported is incorrect

Did PHPStan help you today? Did it make you happy in any way?

Yes, it made me very happy 😊

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions