Skip to content

Incorrect @var PDOStatement<int,string> contains unresolvable type #14206

@zorac

Description

@zorac

Bug report

When using a PDOStatement with mode PDO::FETCH_COLUMN I want to be able to type the statement with the appropriate type for the column, e.g. @var PDOStatement<int,string>.

For PHPStan versions up to 2.1.38, this works correctly and no errors are reported. From PHPStan 2.1.39 onwards, this now reports:

PHPDoc tag @var contains unresolvable type.
🪪  varTag.unresolvableType

Code snippet that reproduces the problem

https://phpstan.org/r/0122fc0d-29d4-4aa1-8a57-480dc399d1de

Expected output

No errors found.

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

PHPStan is fantastic at helping me find bugs before they even get committed and pushing me in the direction of writing better code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions