> Le 12 mai 2022 à 23:11, Larry Garfield <la...@garfieldtech.com> a écrit :
> 
> For the `callable` type declaration, I'm not opposed but is it redundant with 
> the existing deprecation?  When would you pass a callable to something and 
> not end up calling it anyway, which would trigger the existing deprecation?  
> (Meaning in practice you'd always get 2 deprecations, which are not 
> necessarily better than one.)


Although such a callable is probably intended to be called at some point, it is 
not necessarily called immediately, and it may be easier to track the source of 
it when you trigger the deprecation earlier. Example:

```php
public function registerErrorHandler(callable $onerror) {
    $this->onError[] = $onerror;
}
```

(Of course, this argument also holds for `is_callable()`.)

—Claude

Reply via email to