Skip to content

Introduce ReflectionProperty::isUnset() #18620

Open
@mvorisek

Description

@mvorisek

Description

There is a difference between uninitialized and unset property when magic method like __get() is defined. The need of these two states was discussed in #9389.

Currently there is no way to detect if property is just uninitialized or also unset, so from the observable state, it is impossible to tell the property behaviour of a given object.

repro: https://3v4l.org/lDeXi

This is a feature request to add ReflectionProperty::isUnset() method.

An alternative would be to update property_exists() function behaviour - https://www.php.net/manual/en/function.property-exists.php#116824 - which does not account for unset property since it was introduced.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions