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).
> 
> #[SupportsDynamicProperties]
> class Foo { ... }

I like this approach.

> I struggle here, because the opt-in approach is the most BC, but I actually
> 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

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to