[RFC] Allow Readonly Property Defaults - #22588
Conversation
The engine has a non-optimal error here. Will be addressed in a separate PR. Ref: php#22588 (comment)
The engine has a non-optimal error here. Will be addressed in a separate PR. Ref: php#22588 (comment)
20031f3 to
6937610
Compare
TimWolla
left a comment
There was a problem hiding this comment.
Implementation and tests now LGTM. Can you do the rebase and apply your new lock/unlock helper onto clone as well to keep this internally consistent. Ideally four commits:
- Introduction of new helper.
- Use of helper for clone.
- Serializer change.
- Allowing defaults on readonly + Tests.
661dae8 to
fd7a6d2
Compare
That's done, @TimWolla. Actually, wouldn't it make sense to get the first two commits merged on their own? They are a nice cleanup. Could you cherry pickt them? Or should I PR them separately? Would also make the diff smaller here. |
Yes, feel free to PR them separately. The introduction of the new helper should also get a UPGRADING.INTERNALS entry then. The request to split this into clean commits was both to ease review and to leave the option of picking them separately. |
fd7a6d2 to
fb02215
Compare
|
The RFC was accepted. I would appreciate if someone could help me to get this merged. Thank you. |
|
@NickSdot Can you rebase onto the latest master and perhaps already add NEWS / UPGRADING? “Core” would be the correct category. |
|
I also just asked for someone to take over the review of #22718, since I won't get to it before Beta 1. |
fb02215 to
6892b60
Compare
6892b60 to
b9f901a
Compare
Co-authored-by: DanielEScherzer <daniel.e.scherzer@gmail.com>
DanielEScherzer
left a comment
There was a problem hiding this comment.
I took a look at the reflection code, and it shouldn't need to be updated, but can please add
- a test case for
ReflectionProperty::__toString()with a readonly property with a default - a test case for
ReflectionClass::__toString()with a readonly property with a default
?
RFC: https://wiki.php.net/rfc/readonly_property_defaults
Discussion thread: https://news-web.php.net/php.internals/131760
Voting thread: https://news-web.php.net/php.internals/132096