Introduce `ReflectionProperty::isUnset()`
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked 3v4l.org reproduction and the existing ReflectionProperty API entry point in php-src. Define the behavior difference between an uninitialized and an unset property, then confirm that ReflectionProperty::isUnset() can expose it without changing the alternative property_exists() behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, php
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100