On Tue, Apr 11, 2023, at 4:32 PM, Jeffrey Dafoe wrote:
> Can you expand a bit more on your use-case?
>
> We have a lot of classes, a small portion of which use dynamic
> properties, but we do not necessarily know which ones do. It’s
> different than, for example, a change to the count function. We can
> search for all instances of “count” but not for dynamic properties. I’m
> unsure if it’s practical to run deprecations on in prod and our test
> suite, although substantial, doesn’t cover all code paths.
Tools like PHPStan and Psalm can do a pretty good job of finding all dynamic
property usage for you, without needing to write a test suite for it. They'll
treat them as an error, but it should give you a good sense of where to add the
attribute.
It won't be perfect, but it will probably catch the lion's share of them unless
you're doing very dynamic things. ($this->{$foo[$bar]} = 5, or stuff like
that.)
--Larry Garfield
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php