Skip to content

Complaining about isset on general object properties (as returned by the likes of json_decode()) #12390

@dktapps

Description

@dktapps

Bug report

This requires enabling strict rules, although strict rules doesn't seem to be the problem directly.

I'm not sure if this is intended or not, but it wasn't reported as an error before 2.x.

When the specific type of object isn't known, checking for isset on object can be used to inform its shape, so reporting an error about this doesn't make any sense to me.

Code snippet that reproduces the problem

https://phpstan.org/r/8bf0e12b-3cc8-4b4b-a086-2c4d15d5a7a1

Expected output

No error should be reported

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions