-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Readonly properties #879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Readonly properties #879
Conversation
@TazeTSchnitzel Can I ask in which case readonly properties are useful? Wouldn't it be better to implement a thing like lazy constant initialization so that constants could be declared and once declared they would have to be initialized in constructor? |
@Kubo2 did you read the linked rfc? |
@staabm Aha... sorry, I only read the changes |
RFC was withdrawn. |
would be nice to have, similar to Typescript's readonly modifier https://www.typescriptlang.org/docs/handbook/classes.html |
It's high time to bring it up. |
Over time, it would pay to transition towards constant properties that can
only be assigned to once (i.e. initialized), ideally in the constructor.
One of those steps on a path towards true OOP.
…--
Cheers,
Kubis
El mié., 9 de oct. de 2019 a la(s) 22:14, Anton Karpov (
notifications@github.com) escribió:
It's high time to bring it up.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#879?email_source=notifications&email_token=ABUQKJ5OEROAC2G46NQVIVLQNY3RVA5CNFSM4AWJYKS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAZFZGA#issuecomment-540171416>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABUQKJY6HPWPKC2A4REX7L3QNY3RVANCNFSM4AWJYKSQ>
.
|
RFC: https://wiki.php.net/rfc/readonly_properties