Re: [RFC][DISCUSSION] - Immutable classes and properties
| From: | Stanislav Malyshev | Date: | Mon, 16 Jan 2017 21:38:35 +0000 |
| Subject: | Re: [RFC][DISCUSSION] - Immutable classes and properties | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-97795@lists.php.net to get a copy of this message | ||
Hi!
> Discussion is open for following rfc
> https://wiki.php.net/rfc/immutability
The RFC says:
> Safe for concurrency.
I'm not sure - what concurrency are you talking about?
> Value objects, DTO's etc. can be easily created.
Value objects can be easily created right now if you follow generic best
practices - private properties and no setters, here you go with value
object.
> Properties can be public which removes need for getters without
allowing state modification.
Not sure why it is a good thing to have public properties? Also, not
sure how you are going to resolve references to such properties.
--
Stas Malyshev
smalyshev@gmail.com