Re: Final properties
| From: | Fleshgrinder | Date: | Mon, 11 Apr 2016 17:22:57 +0000 |
| Subject: | Re: Final properties | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-92203@lists.php.net to get a copy of this message | ||
On 4/11/2016 7:12 PM, Fleshgrinder wrote:
> Support for mutable public properties is a different story but allowing
> them would destroy the encapsulation and I am against it without anyone
> bringing some good arguments that convince me.
>
This of course would be different with the RFC you mentioned because
then they are not simply public mutable properties anymore but a real
method will be called that allows hooks. I wrote the above under the
assumption of:
interface Example {
final public DateTimeImmutable var $created;
}
Where you end up not being able to hook into assignments and I am
against the introduction of such a feature. ;)
--
Richard "Fleshgrinder" Fussenegger
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc