On Thu, Sep 20, 2018 at 9:50 AM, Levi Morrison <le...@php.net> wrote:
> This will be my last reply to this thread.
>
This will be my first and, God willing, only reply to this thread.

> Fundamentally:
>
> class User {
>      public int $id;
>      public string $preferred_name;
>      public string $username;
>  }
>
> ^ This never permits null properties, and using them without
> initializing them is an error, and you get notified by the runtime
> that such a thing happened. This is good and desirable behavior.
>
This is bad and undesirable behavior.

Deferring the error to on-read makes the properties magic and
unknowable.  This is broken by design.  The RFC got my vote because
broken never stood in PHP's way, and at the very least, as a library
author, I am empowered to aggressively initialize my properties even
if the runtime gives me insufficient protections from coding errors.

A static analysis engine can pick up the slack where the engine falls
short, so that's my yes vote, but it's not an endorsement of the
fundamentally broken design.

-Sara

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to