[RFC] Property write visibility
| From: | André Rømcke | Date: | Mon, 29 Jun 2020 09:41:59 +0000 |
| Subject: | [RFC] Property write visibility | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-110768@lists.php.net to get a copy of this message | ||
Good morning Internals,
I'd like to start discussion on a new RFC proposing a way to be able to
(optionally) specify property
write visibility, separate from read:
https://wiki.php.net/rfc/property_write_visibility
This enables readonly, write-only and immutable like semantics for PHP's
properties.
These are the common use cases where users tend to resort to magic methods
or setter/getter
methods. This proposal will as such avoid unnecessary boilerplate, makes
coding easier and more
ergonomic, and in the case of magic method usage improve performance.
Best,
André Rømcke