Skip to content

Introduce ReflectionProperty::isUnset() #18620

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mvorisek opened this issue May 21, 2025 · 0 comments
Open

Introduce ReflectionProperty::isUnset() #18620

mvorisek opened this issue May 21, 2025 · 0 comments

Comments

@mvorisek
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants