Skip to content

php type resource hidden by class Resource #10399

@dbu

Description

@dbu

Bug report

the doc states that phpstan will assume resource to mean the php type resource unless the FQN is used.

however, current versions seem to do the opposite

when i have a class Resource in the same namespace, i can't specify resource and get an error that the case is incorrect. i tried \resource as well, but that gives Parameter $data of method Foo\HelloWorld::sayHello() has invalid type resource.

Code snippet that reproduces the problem

https://phpstan.org/r/67bc0abd-313b-41ca-ae65-7833ff531f35

Expected output

  • no errors -

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

❤️

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