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

This is only part of a thread. view whole thread
November 15, 2021 13:53 (=?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?=)
On Mon, Nov 15, 2021 at 2:52 PM Andreas Heigl <> wrote:

> > And as far as I can see from the PR associated with this RFC it will not > make life easier for the internals team. It is not like there will be > hundreds of lines code less to maintain. On the contrary. There is more > code and more logic to maintain [2]. >
Sometimes it needs to be worse until it's better. Some points that evolved during discussion also mentioned the intention of how easy to allow it to be to opt-in and in the end the attribute was chosen as the easiest one. Even if the intention was to simplify the code to maintain, it was not clear how much PHP users would want to stay without this feature. And the problem was that using the attribute, it would not be easy to remove it in PHP 9. But at least it would give a better sense of usage once we get to PHP 9 so it can be completely removed only in PHP 10+ or to use a more strict opt-in mechanism. So yes, you are right, having it like this would make the code a bit worse to maintain for 8 years and easier to maintain after that, if I got it right. But the benefit related to the dynamic properties bugs reduction would be seen in userland starting with PHP 8.2. Regards, Alex