On 26/05/2021 11:13, Joe Watkins wrote:
Hi internals,
In response to: https://bugs.php.net/bug.php?id=78480
I implemented: https://github.com/php/php-src/pull/7029
My general feeling remains that the "uninitialized" state is an awkward
hack that we should be working to eliminate with better constructor
semantics. A variable that remains uninitialised after the constructor
almost always indicates a bug in the constructor, not a state that the
rest of the application should care about.
On the other hand, we have already allowed unset() to produce this
special state, with defined behaviour for __get, so possibly the genie's
out of the bottle, and we have to embrace it as a new "type".
On the gripping hand, this is likely to lead to even more confusion
about what exactly the different states are: properties declared with a
type, properties declared without a type, properties not declared at
all; all of which can be null, a non-null value, or completely unset.
People already complain that isset() returns false for null variables (I
disagree, but...); this function could end up even harder to explain.
Regards,
--
Rowan Tommins
[IMSoP]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php