Re: RFC - Immutable classes
| From: | Fleshgrinder | Date: | Sat, 10 Sep 2016 10:55:01 +0000 |
| Subject: | Re: RFC - Immutable classes | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-95895@lists.php.net to get a copy of this message | ||
So? Where are we now? CoW is definitely doable and I personally think
that it's the best approach because the engine has full control that
nothing goes south. I also do not think that it's magic in any way since
developers have to add the _immutable_ keyword explicitly to the class.
That this modifier modifies the behavior should be obvious, _abstract_
and _interface_ also do that.
Since I mention _interface_. I've been thinking about it and I would
prefer it if the _immutable_ modifier also works for interfaces.
Interfaces are pure abstract classes after all and they are meant to
define a contract for implementors. I cannot see any good reason why it
should not be allowed to force implementors of an interface to be
immutable; same as with abstract classes.
Another aspect that we should discuss is how immutable properties should
behave in case we decide for CoW.
@Larry what do you think about the CoW proposal?
--
Richard "Fleshgrinder" Fussenegger
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc