Re: Analysis of property visibility, immutability, and cloning proposals
| From: | Thomas Nunninger | Date: | Tue, 29 Dec 2020 21:07:56 +0000 |
| Subject: | Re: Analysis of property visibility, immutability, and cloning proposals | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-112647@lists.php.net to get a copy of this message | ||
Am 28.12.20 um 21:23 schrieb Larry Garfield:
There's been a number of discussions of late around property visibility and how to make objects more immutable. Since it seems to have been well-received in the past, I decided to do a complete analysis and context of the various things that have been floated about recently. The full writeup is here: https://peakd.com/hive-168588/@crell/object-properties-and-immutability I hope it proves stimulating, at least of discussion and not naps.A really nice writeup and interesting to read. But I have a question:
We then end up with the following combinations: * public read, private write * public read, private read, init write * public none, private write * public none, private read * public none, private read, init writeWhat is the difference between (a) "public none, private read" and (b) "public none, private read, init" write"? When will (a) be initialized? And if there is really a useful case for (a) why is there no "public read, private read"? Regards Thomas