Re: Deprecated partially supported callables: should is_callable() throwa deprecation notice ?

From: Date: Wed, 20 Apr 2022 18:16:05 +0000
Subject: Re: Deprecated partially supported callables: should is_callable() throwa deprecation notice ?
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-117554@lists.php.net to get a copy of this message
> Le 20 avr. 2022 à 12:42, Rowan Tommins <rowan.collins@gmail.com> a écrit : > > > The situation with is_callable is a bit less clear, because it depends on how the function is > actually being used. If a false return is eventually equivalent to some kind of error, then the > behaviour would ideally match callable parameters. In other examples, though, false is actually a > valid state, so it's not clear what a user should change to avoid the deprecation notice. > > 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. 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. —Claude

« previous php.internals (#117554) next »