Re: Future stability of PHP?
| From: | Larry Garfield | Date: | Tue, 11 Apr 2023 18:13:01 +0000 |
| Subject: | Re: Future stability of PHP? | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-119939@lists.php.net to get a copy of this message | ||
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