On 19 July 2018 at 15:20, Christoph M. Becker <cmbecke...@gmx.de> wrote:

> It seems to me that either of these proposals would render the lazy
> initialization pattern outlined in the “Overloaded Properties”
> section[1] invalid.
>
> [1] <https://wiki.php.net/rfc/typed_properties_v2#overloaded_properties>
>


Hm, I guess I didn't read that section carefully enough.

It strikes me that that entire code pattern is a hack due to lack of
property accessors, and it seems a shame to reduce the usefulness of the
language's type system just to support it.

>From the responses on this thread, I get the feeling I'm in the minority,
but it still feels utterly wrong to me that a property marked as
non-nullable offers no guarantee at all that it will actually hold a valid
value.

Regards,
-- 
Rowan Collins
[IMSoP]

Reply via email to