> Le 20 avr. 2022 à 12:42, Rowan Tommins <rowan.coll...@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.


PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to