Skip to content

@return type in __toString() method ignored #3226

@koriym

Description

@koriym

Bug report

@return type in __toString() method ignored.

Code snippet that reproduces the problem

https://phpstan.org/r/7018eeec-7f5c-4f0e-9f3d-8a1ffd732437

Expected output

Should be no error produced in this snippet.

Note: __invoke and __debuginfo works fine. (via @wanda_ta)

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