Hi all,
I have finally written up an RFC I have been considering for some time:
Harmonise "untyped" and "typed" properties
RFC URL: https://wiki.php.net/rfc/mixed_vs_untyped_properties
Currently, changing a property declaration from "private $foo" to
"private mixed $foo" changes its behaviour in significant ways, even
though no actual type checks are added. This RFC seeks to remove those
differences, by extending the "uninitialized" state currently reserved
for typed properties to cover all declared properties:
* Properties without an initial value will be "uninitialized", not "null"
* Calling "unset" on a declared property will make it "uninitialized",
rather than the current complex behaviour
There are a handful of open questions still in the RFC, but I wanted to
present an initial draft to start the discussion, because the current
behaviour is quite hard to explain in a short e-mail.
Please let me know your thoughts.
Regards,
--
Rowan Tommins
[IMSoP]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php