# [RFC] Deprecate partially supported callables

- Thread: https://externals.io/message/115916
- Original archive: https://news-web.php.net/php.internals/115916
- Started by Nikita Popov on 2021-09-02T14:32:32+00:00
- Messages: 5
- RFC: Deprecate partially supported callables (Implemented (PHP 8.2)) — https://externals.io/rfc/deprecate_partially_supported_callables.md
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #115916 — Nikita Popov — 2021-09-02T14:32:32+00:00

URL: https://externals.io/message/115916#115916

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

---

## #115917 — come.chilliet@fusiondirectory.org — 2021-09-02T15:06:08+00:00

URL: https://externals.io/message/115916#115917 · In reply to: #115916

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

---

## #115920 — Nikita Popov — 2021-09-02T15:45:24+00:00

URL: https://externals.io/message/115916#115920 · In reply to: #115917

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 :
>
> > […]
>
> 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

---

## #115921 — flaviohbatista@gmail.com — 2021-09-02T18:07:18+00:00

URL: https://externals.io/message/115916#115921 · In reply to: #115920

> On Thu, Sep 2, 2021 at 5:06 PM Côme Chilliet <
> come.chilliet@fusiondirectory.org> wrote:
>
> > […]
> proposes
> > […]
> kinds
> > […]
>
> 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:
>
> > […]
> "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

---

## #116215 — Nikita Popov — 2021-10-04T12:19:14+00:00

URL: https://externals.io/message/115916#116215 · In reply to: #115916

> 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
