Re: [PHP-DEV] Re: [RFC] Deprecate dynamic properties

This is only part of a thread. view whole thread
  116265
October 12, 2021 13:59 nikita.ppv@gmail.com (Nikita Popov)
On Tue, Oct 12, 2021 at 3:52 PM Levi Morrison morrison@datadoghq.com>
wrote:

> > Based on the received feedback, I've updated the RFC to instead provide > an > > #[AllowDynamicProperties] attribute as a way to opt-in to the use of > > dynamic properties. As previously discussed, this won't allow us to > > completely remove dynamic properties from the language model anymore, but > > it will make the upgrade path smoother by avoiding multiple inheritance > > issues. > > Quoting the updated RFC: > > We may still wish to remove dynamic properties entirely at some later > > point. Having the #[AllowDynamicProperties] attribute will make it much > > easier to evaluate such a move, as it will be easier to analyze how much > > and in what way dynamic properties are used in the ecosystem. > > But in this place it does not mention PHP 9.0. Other places still > mention converting it to an error for PHP 9.0. Is that still the plan? >
The current RFC proposes to make dynamic properties an error for classes without #[AllowDynamicProperties] in PHP 9.0. On the other hand, classes using the attribute will be able to continue using dynamic properties without error. (That is, as usual: Deprecations are converted to error in the next major version.) Regards, Nikita