Skip to content

Allow throwing exceptions from __toString() not detected since level 4 #5952

@llaville

Description

@llaville

Bug report

Throwing exceptions from __toString() is allowed since PHP 7.4 (see https://wiki.php.net/rfc/tostring_exceptions), but PHPStan 1.1.1 does not detect such feature !

Code snippet that reproduces the problem

https://phpstan.org/r/67c99d00-a5e9-4397-b27d-81e23b2794f4

Expected output

No error

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

Every days when I must put online my code, in open source projects, I always check-it first with PHPStan. Thanks a lot for this great tool I use almost daily :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions