Re: RFC: Locked Classes
| From: | Paul Jones | Date: | Sun, 10 Mar 2019 20:16:08 +0000 |
| Subject: | Re: RFC: Locked Classes | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-104631@lists.php.net to get a copy of this message | ||
> On Mar 10, 2019, at 13:35, Rowan Collins <rowan.collins@gmail.com> wrote:
>
> Hi all,
>
> I'd like to present a new RFC for "locked classes": classes which restrict
> dynamically adding or removing properties from their instances.
Nice. This would help enforce at least one element of immutability in userland; namely, not having
to define
final public function __set() and final public function
__unset() to prevent adding and mutating undefined properties.
--
Paul M. Jones
pmjones@pmjones.io
http://paul-m-jones.com
Modernizing Legacy Applications in PHP
https://leanpub.com/mlaphp
Solving the N+1 Problem in PHP
https://leanpub.com/sn1php