is_callable($deprecated_callable), etc., should throw a deprecation notice
Description
Deprecation of partially supported callables was accepted in RFC and implemented in #7446.
The callable type and the is_callable() function were wilfully exempted from the deprecation notice. While I can guess some of the reasoning behind this decision, real world code shows that this is problematic, and a bunch of code would silently break in 9.0.
See the links in https://externals.io/message/117342#117374 for some examples.
As additional example, I have found few instances of the following pattern in my own code base:
if (is_callable([ 'self', 'some_prefix_'.$foo ])) {
self::{'some_prefix_'.$foo}(...$args);
}
Request: The callable type, the is_callable() function (and any other function that currently supports partially supported callables) should throw a deprecation notice whenever they encounter a “deprecated callable”.
With the proposed change, we lose the possibility to feed is_callable() with arbitrary input without triggering a deprecation warning in PHP 8.x (x ≥ 3), save resorting to @.
However, in real world, is_callable() is almost never given totally arbitrary stuff (e.g., when the stuff includes the string "static", that string is usually hard-coded somewhere); so that it is not an issue in practice.
@jrfnl made an RFC for this.
And that RFC has been accepted, and implemented in the meantime.