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

This is only part of a thread. view whole thread
August 25, 2021 21:02 (Ben Ramsey)
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable

Sara Golemon wrote on 8/25/21 10:28:
> My gut-check says an Attribute works well enough. This will unlock the=
> class (disable deprecation warning) in 8.2+ and be ignored in earlier > releases (8.0 and 8.1 would need an auto-loaded polyfill userspace > attribute obviously, but that's a tractable problem). >=20 > #[SupportsDynamicProperties] > class Foo { ... }
I like this approach.
> I struggle here, because the opt-in approach is the most BC, but I actu= ally
> think you're right. I think[citation needed] that dynamic props are > probably rare enough that as long as the escape hatch is clear, we can = be a
> little more bold about nudging the ecosystem forward. I'd feel better about this if we had that citation. In modern code, I
agree they are probably rare, but I think there's a lot of legacy code that makes heavy use of dynamic properties as an important feature of PHP. (I'm working on one such project right now.) Cheers, Ben --oGolVVusa5BmXiFJpZwc3PyaAUAQb3TQ5--