-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Deprecate dynamic property creation with #[AllowDynamicProperties] escape hatch #7571
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
Conversation
10a0286
to
a65dcea
Compare
f90e5d6
to
1d6be97
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had some minor comments/questions, easily fixable
While leaving the merits of this change to the voters, we had a technical question about this implementation. Our framework uses dynamic properties to load models in a base class which all user app extend for each MVC + route connection. This is sometimes done with a trait in the child class and sometimes automatically in the base class. Will this evaluate the |
The attribute also affects child classes. Quoting from the RFC:
If you add the attribute to the base class, then all classes that inherit from it can use dynamic properties as well. (You do need to extend from it -- using a trait with the attribute or implementing an interface with the attribute won't have an effect. And now that I say that, the implementation should probably explicitly forbid doing that.) |
(Comment deleted and replaced with message to php internals list: https://news-web.php.net/php.internals/116519 ) |
f87f850
to
981a491
Compare
These would have no effect -- for the sake of clarity, reject them outright.
Per Tyson's request.
Also switch it to use de_DE, which is more standard in our test suite.
981a491
to
536d440
Compare
Merged as 902d643. |
This is a variant of #7390 that adds an
#[AllowDynamicProperties]
escape hatch, to explicitly allow using dynamic properties on a class without deprecation.RFC: https://wiki.php.net/rfc/deprecate_dynamic_properties
TODO: Plaster
#[AllowDynamicProperties]
over large swathes of tests.