Re: [RFC] [VOTE] Immutable/final/readonly properties
| From: | Levi Morrison via internals | Date: | Tue, 17 Mar 2020 22:23:37 +0000 |
| Subject: | Re: [RFC] [VOTE] Immutable/final/readonly properties | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-109116@lists.php.net to get a copy of this message | ||
Chiming in to express my disappointment that
final wasn't a voting choice.
1. It's already reserved, so we don't have to worry about a new keyword.
2. Another very popular language that is similar to PHP already uses it (Java).
I voted no for a variety of reasons, which includes:
- It doesn't support default values, and doesn't defend that choice
well in my opinion.
- I think clone should be able to change the value. It's similar to
a constructor, and in fact I'd call it a "copy constructor."
- The property type is mandatory. I am less certain about this, but
do not like it.
I do appreciate the RFC, but think it needs a bit more work.