Skip to content

PHP 8.2: property_exists on parent class gives false positive #8727

@levu42

Description

@levu42

Bug report

When I use property_exists() on a parent class, it assumes that it's always used on that class, not possibly on a child class. That should only be the case in private methods, not in protected & public.

For some reason, it does not seem to give any error on PHP8.1, only 8.2, according to the PHPStan playground.

Code snippet that reproduces the problem

https://phpstan.org/r/04888761-38fb-471c-9e6c-2fd61357ff52

Expected output

No error

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