Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103236 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 51269 invoked from network); 23 Sep 2018 22:24:16 -0000 Received: from unknown (HELO mail-it1-f175.google.com) (209.85.166.175) by pb1.pair.com with SMTP; 23 Sep 2018 22:24:16 -0000 Received: by mail-it1-f175.google.com with SMTP id j81-v6so7850579ite.0 for ; Sun, 23 Sep 2018 11:31:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=I5DLEGdu9SvjFyQ4N6JK3Q6vIvsn/+5IvYwVvWCZPxI=; b=p35IhGn7qYHo3QoK3yX2JpjgDtpKybJ2SCNYrJlbguTf4IbuTIzmA/0LBVyWW8Zb2F XAa0HhNbjXdbrnIfDuSzlfPhRQ8kedJpBMHkbTcjTnO3DVtfWM3hZoPRyMpIIGBWy5AQ I5P3FyZCGA7lL7ILh0AStEoly7rHGooDSJzf6zrwUnF79yRwfEup62dWtVR7xYEnE3xg tudDuammHhxfx8QFUwHeNAZ6HZJib4qkELwGCivuqj49hke5tpSwRZTeDaoG+swxeNZD TOcOVIQG7FCexUf7QwEZkyOfWJKznkUtSBCnVM9XSh5gSqlZQ7ajHe9EaWPk0hrKPfV8 vmSg== 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=I5DLEGdu9SvjFyQ4N6JK3Q6vIvsn/+5IvYwVvWCZPxI=; b=YD0gJR6ZtgrwZpdH3m1mHJRr27jiKPIeQCPUBu1p6Tnfq6GRWX+lcKs7mdBZ5ixyvr k9b/lY6eYLyLsDmz2xtoVaww9dSCYunjaxgDVobh/qgwsD0VqeiSySNDB9G/4T9/n9KG KRJq+kAk1VQ22LNDUAtueDueFgcFRMumy9t6+u3dYJqclR0VgLrsRWr9CxmRegEGfnzB 69mGvAZ1xBZq2VlsLriR1ffW14j90A0rFVQfDFH8Yf9klT1Ifh5ZbtouwUs/yEiCieu3 0oRnvYIH4WWrX6MjMVdh8j8xGzwiEnNdUjlRONCplbbFQTIEDG8kiS8KACXCjRyYRibj 9KHA== X-Gm-Message-State: APzg51CJ311p03z+TAib4X6nO4KhIjjLPRE4anOr/ByY/ouvK681Zm5i sAnt1qJcBQ/XjSJYw7pUnKlPwvO7N4LxBrrcD2fqwRiO X-Google-Smtp-Source: ANB0VdZMdIa4NIVLeRjOvC5i8SDf/OiOFSvK+z5MXNSWYQks1j5W47wsY/p4kC63cGcwEv9cmn3xgbpBPMOYF7XnXUc= X-Received: by 2002:a02:9936:: with SMTP id r51-v6mr6477649jaj.46.1537727501337; Sun, 23 Sep 2018 11:31:41 -0700 (PDT) MIME-Version: 1.0 References: <1681263.Ri4PIu1jiQ@vulcan> In-Reply-To: <1681263.Ri4PIu1jiQ@vulcan> Date: Sun, 23 Sep 2018 15:31:30 -0300 Message-ID: To: Larry Garfield Cc: PHP Internals Content-Type: multipart/alternative; boundary="0000000000007a891505768e15d4" Subject: Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2 From: david.proweb@gmail.com (David Rodrigues) --0000000000007a891505768e15d4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Em dom, 23 de set de 2018 =C3=A0s 13:09, Larry Garfield escreveu: > 3) Object properties may be type hinted and the class author has until th= e > end > of the constructor to make sure they're fulfilled, otherwise TypeError on > the > spot (what I'm proposing). > Item 3 could not be enough, for instance: <<< class Example { public /* string */ $string; public function __construct() { static:: stringParameter ($this->string); } public static function stringParameter(string $string) {} } new Example; >>> It will fail because __construct() uses an uninitialized non-nullable property. Maybe it should throw a new Exception like UninitializedPropertyException when you try to read a uninitialized property like this case. --=20 David Rodrigues --0000000000007a891505768e15d4--