On Wed, 20 Apr 2022 at 19:16, Claude Pache <claude.pa...@gmail.com> wrote:
> > You make a very important claim in your bug report: > > > > > However, in real world, is_callable() is almost never given totally > arbitrary stuff > > > > My concern is that we have no way of knowing whether this is true, and > whether there will always be a clear action for users who see the > deprecation notice. > > In this case, there is always the possibility for them to use the error > suppression operator. That remains easy, and looks like a reasonable use > case of that operator. > The error suppression operator is a big blunt tool, and using it to squash a deprecation notice would be an absolute last resort. Note that in contrast to the strpos() case where both behaviours can be achieved with *permanent* changes, the error suppression would only be a temporary workaround for error logging, with no value in itself. > If we have to balance between addressing the verified issue of not > emitting deprecation notice for well-known and fairly frequent code > patterns, and addressing the potential and non-fatal issue of emitting too > much notices for totally unknown use cases, the choice should be > straightforward. > Again, this is true IF you are correct that one set of patterns is common and the other is not, but so far I've not seen any attempt to find out whether that's true. The idea of ignoring "unknown" use cases seems really dangerous - like closing your eyes so you can't see the bad effects of what you do. What we need to know is whether such use cases are *rare*, or whether the people using them are just not subscribed to this list. One starting point would be to find usages in the top 100 or 1000 packages on Packagist using https://github.com/nikic/popular-package-analysis - perhaps Juliette has already done that when testing their PHPCompatibility sniff? Regards, -- Rowan Tommins [IMSoP]