Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103241 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 73297 invoked from network); 24 Sep 2018 00:43:13 -0000 Received: from unknown (HELO mout.gmx.net) (212.227.15.15) by pb1.pair.com with SMTP; 24 Sep 2018 00:43:13 -0000 Received: from [192.168.2.137] ([91.8.166.159]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MOOpx-1g7BbW1Ti1-005n81; Sun, 23 Sep 2018 22:50:39 +0200 To: Rowan Collins , internals@lists.php.net References: <1681263.Ri4PIu1jiQ@vulcan> <1476841B-EEBA-4513-8DD8-7ACE1F662372@gmail.com> <95a7902d-8451-06ee-debf-6f03c4fd7190@gmail.com> Message-ID: <0f589b64-5c3b-21b2-a396-b626054edb41@gmx.de> Date: Sun, 23 Sep 2018 22:50:43 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <95a7902d-8451-06ee-debf-6f03c4fd7190@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:4TaKnEBFGw+kbGGGZYw8LOxxvqbMSV/rbm636HTGQX8T8H1W0Mu q53WOPMq19GP9GdwUXQfeD94gXjnFTP6T6LrqDqvQFS8HzyCg1h5JEna8v/S0Tm+1IYHfvB fyINh0o4511bP0hqJzwOK5ANzfTW8alWU/upA/kfXC2j3DSmu+nKXNlKGw+art+rrwZ7OuN 884rxkQAFOthdTrMs/vSA== X-UI-Out-Filterresults: notjunk:1;V01:K0:dQsx8VRO1Zw=:xCjYws1HCC8P4JGuc+bBLj UtOxI+5le6szRrhmfkvUntWd/x+d0tVLngfbQcg3Yab74GL9F3Z5AO9UiytoJ/kNYbVRZ3uMz K3W+OC6S2UpiwZ86GQs8zyH4wLoJhZ3VVY75BAgH+cYc4AoU4LqQHuKbkWV2cCuvzLUnVhY12 8kUsW8DjY4b2y1TYj31jKJFSALYaz/oXlg3+opgrAxyC/iTczG1t4VNsbo3jOtWov9+45/h94 hQU5tLp4ZPILK7zTtUTcDIRjOxzUAfuP4jMHtgoBFSa72rtSW5UqWqQtEPOgbpUA3gV/E+MB/ EmXJhQ54Msuqz13iC9lw1YmomiILTX4dUOrL3p5ek6f3zxkIssvIkVB7gwcb7ax5B8BtpREjA GA/ced9/ZL74C9IlCXaqynvrzQwwFOLth9ChhypRzlngjQhE1sbNh2UZJIWJjdc0UqlLeV58a O1yAYb95ciHyeTyOSk+By4BBmJ0G1ehc995TmDNSiurkZDiMRQfxINM6ssQ7c4xF3hm5YlEhy kyTevXjkGVihuj9oj2JTCCRnZMkoA9/2gdVT1zMGnHMiUJHIrGRuWV+dtAJfUuyAnj9bfResc 74KMjEafJb3d0tBo+TWIPATj5tlWD7a3pHa/3IWPzq56GqXV+8C2UB1te/PFuugvkk75fk/n7 wos+yMFzCMj5K/ZIR95UcqAMkbR+7J7Dt3ijWTuopFranr6bOncQe+sa+X7mXkF/AwnBeNud6 ESX67pBUYnMmlZu4MSjMmlOLEzsj7CklCi3qjXFmIpKhtIOvb3zFqLOv6TcHzbugjA5rWi83N QK3Ppb+9fEMUv948QtWjOnkYz4BRlToz+HbTPmd9ZWTTWwLQYk= Subject: Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2 From: cmbecker69@gmx.de ("Christoph M. Becker") On 23.09.2018 at 22:07, Rowan Collins wrote: > On 23/09/2018 19:41, Claude Pache wrote: >> >>> 3) Object properties may be type hinted and the class author has >>> until the end >>> of the constructor to make sure they're fulfilled, otherwise >>> TypeError on the >>> spot (what I'm proposing). >> Just to be sure you don’t miss the herd that this elephant is concealing: >> >> In addition, you *must* forbid unset() on those properties... > > We "must" forbid this IF we aim to guarantee that the object never has > uninitialised properties; but the current consensus is that we can't > make such a guarantee without changing a lot of other parts of the > language. > > There are strong feelings that unset should be available for use in > lazy-initialisation hacks, so this is likely to remain one of the > back-doors which will let elephants in, unless and until someone comes > up with a replacement for that hack. In my opinion, explicitly *declared* properties should not be unsettable. We don't allow to undefine constants, functions, classes etc. either. Adding and removing other properties could still be allowed. -- Christoph M. Becker