Re: Re: [RFC] Deprecate dynamic properties
| From: | Nikita Popov | Date: | Tue, 12 Oct 2021 13:59:07 +0000 |
| Subject: | Re: Re: [RFC] Deprecate dynamic properties | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-116265@lists.php.net to get a copy of this message | ||
On Tue, Oct 12, 2021 at 3:52 PM Levi Morrison <levi.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