Re: [RFC] Deprecate dynamic properties

From: Date: Wed, 25 Aug 2021 21:02:14 +0000
Subject: Re: [RFC] Deprecate dynamic properties
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-115837@lists.php.net to get a copy of this message
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: [application/pgp-signature] OpenPGP digital signature signature.asc
« previous php.internals (#115837) next »