On Tue, 21 Apr 2020 at 14:08, moliata <moli...@protonmail.com> wrote:
>

> I wanted to ignite a friendly discussion whether
> PHP should allow typed callable properties.

IMO no.

Trying to fix the problems with callables would be a huge amount of
work, and not actually give that much benefit. Even just documenting
the problems with callables* is a non-trivial amount of work, and I
suspect there are many horrors lurking with the SPL code related to
them.

> I believe we should look into...

I'm pretty sure that choosing a different problem to solve that:

* would be easier to solve.
* provide more benefit in the long term.
* not require breaking a lot of userland + internal code immediately,
but instead allow for migration over a longer period.

My thoughts on adding 'function types' are here:
https://github.com/Danack/FunctionTypes/blob/master/function_type_rfc.md

There's still more than a couple of known problems that need to be
worked through, as well as probably unknown problems lurking. As email
is not a good format for carrying out discussions, if people want to
take part in that discussion, doing it in that repo would be better
imo.

Assuming the problems remaining can be addressed, that would give us a
more useful feature, and the existing 'callables' can be slowly
deprecated and maybe removed from PHP in the distant future.

cheers
Dan
Ack

*[problems with callables] - https://wiki.php.net/rfc/consistent_callables

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

Reply via email to