[RFC] Deprecate partially supported callables

php.internals

Nikita Popov

4 years ago
Hi internals, Currently, there are some callables that are accepted by the "callable" type, but which cannot be used with $callable() syntax. This RFC proposes to deprecate support for such "callables": https://wiki.php.net/rfc/deprecate_partially_supported_callables Regards, Nikita

Côme Chilliet

4 years ago
Le Thu, 2 Sep 2021 16:32:32 +0200, Nikita Popov <nikita.ppv@gmail.com> a écrit :
> Hi internals, > > Currently, there are some callables that are accepted by the "callable" > type, but which cannot be used with $callable() syntax. This RFC proposes > to deprecate support for such "callables": > > https://wiki.php.net/rfc/deprecate_partially_supported_callables
It took me some time to understand that this was not a proposal to remove support for all array/string representation of callables. This should be made clearer if possible, maybe even list the callable kinds which will not be deprecated. Côme

Nikita Popov

4 years ago
On Thu, Sep 2, 2021 at 5:06 PM Côme Chilliet < come.chilliet@fusiondirectory.org> wrote:
> Le Thu, 2 Sep 2021 16:32:32 +0200, > Nikita Popov <nikita.ppv@gmail.com> a écrit : > > > Hi internals, > > > > Currently, there are some callables that are accepted by the "callable" > > type, but which cannot be used with $callable() syntax. This RFC proposes > > to deprecate support for such "callables": > > > > https://wiki.php.net/rfc/deprecate_partially_supported_callables > > It took me some time to understand that this was not a proposal to remove > support for all array/string representation of callables. > This should be made clearer if possible, maybe even list the callable kinds > which will not be deprecated. >
Yeah, I definitely have no intention of deprecating string/array callables in general. If something works in $callable(), then it's going to continue working. Added the following note:
> Normal "function", "Foo::method", ["Foo", "method"] and [new Foo,
"method"] style callables are unaffected by this change. Regards, Nikita

Flávio Heleno

4 years ago
On Thu, Sep 2, 2021 at 12:46 PM Nikita Popov <nikita.ppv@gmail.com> wrote:
> On Thu, Sep 2, 2021 at 5:06 PM Côme Chilliet < > come.chilliet@fusiondirectory.org> wrote: > > > Le Thu, 2 Sep 2021 16:32:32 +0200, > > Nikita Popov <nikita.ppv@gmail.com> a écrit : > > > > > Hi internals, > > > > > > Currently, there are some callables that are accepted by the "callable" > > > type, but which cannot be used with $callable() syntax. This RFC > proposes > > > to deprecate support for such "callables": > > > > > > https://wiki.php.net/rfc/deprecate_partially_supported_callables > > > > It took me some time to understand that this was not a proposal to remove > > support for all array/string representation of callables. > > This should be made clearer if possible, maybe even list the callable > kinds > > which will not be deprecated. > > > > Yeah, I definitely have no intention of deprecating string/array callables > in general. If something works in $callable(), then it's going to continue > working. Added the following note: > > > Normal "function", "Foo::method", ["Foo", "method"] and [new Foo, > "method"] style callables are unaffected by this change. > > Regards, > Nikita >
With this, PHP walks another step towards a much needed cleanup. From me this is a more than welcome change.
-- Atenciosamente, Flávio Heleno

Nikita Popov

4 years ago
On Thu, Sep 2, 2021 at 4:32 PM Nikita Popov <nikita.ppv@gmail.com> wrote:
> Hi internals, > > Currently, there are some callables that are accepted by the "callable" > type, but which cannot be used with $callable() syntax. This RFC proposes > to deprecate support for such "callables": > > https://wiki.php.net/rfc/deprecate_partially_supported_callables >
Is there any further feedback on this proposal? Otherwise I'd open the vote in a few days. Regards, Nikita