Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103205 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 53401 invoked from network); 20 Sep 2018 18:44:10 -0000 Received: from unknown (HELO mail-lj1-f169.google.com) (209.85.208.169) by pb1.pair.com with SMTP; 20 Sep 2018 18:44:10 -0000 Received: by mail-lj1-f169.google.com with SMTP id m84-v6so8644907lje.10 for ; Thu, 20 Sep 2018 07:50:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lSrF7DYuaa6TXDdgW7FtZAAlwEvCGvUJnr6ElYVbqzM=; b=qbTNKokQ/XBY+M7wdIm2of0rpWwvOMvDH2P1SnVa9338HOTuPnZskG8EqQX4wq8Eps 18G8glLKQVxem73QdBuJumhzGPhNhd3Gm7Lg4da4W+vISYtsPA2unRekqsSgCofpRORH UgDimoGYvREfWlEM6FnCgpXaLGXYXN2dsM3wHyGN1DP8+PaLYy9AMXifh6gh+6OQllY3 z2Vp5fMGTXmEFOOnpR81fQtTEehTMZibpe6NIsUYrnOzhRbwXUxM2CW1NOepg82l4fZP 8HK78PZbf6obCIAJtUEfPerpHCZ/WeJsVYsb5lBAnx+4wX9WRNf1vr/4XFmYEHAHo1gj cZiQ== X-Gm-Message-State: ABuFfoi5pZxsJNVa+zGT31QbU+Q4eyYBjPlyG84mKcd8Bz0TK8bRJncP /aHJ+JPoe50nq3u65/mUiET8D7iK8Y/lLJwKbWs= X-Google-Smtp-Source: ACcGV62lJMtNcpmqR5jbfsJrPTvEZnjIbl30OURml3Go4lQmB3Pj9du1M9zd+BIDr11Kqguo9mBXhTGYI+LBZMolNGs= X-Received: by 2002:a2e:2ac3:: with SMTP id q186-v6mr705039ljq.123.1537455047960; Thu, 20 Sep 2018 07:50:47 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 20 Sep 2018 08:50:30 -0600 Message-ID: To: Rasmus Schultz Cc: Rowan Collins , internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2 From: levim@php.net (Levi Morrison) This will be my last reply to this thread. Fundamentally: class User { public ?int $id; public ?string $preferred_name; public ?string $username; } ^ This permits null properties at all times. This is acceptable behavior if null is valid for the domain. It is not valid for this domain -- all 3 are required. 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.