Re: [PHP-DEV] [Discussion] Revisiting typed closures

[email protected] (Seifeddine Gmati)
Newsgroups php.internals
Message-ID <CAFyg4Hj6aZBhPsfFfon9WdC7pSsO8Fp_cnh1V_wWQvq_jWYjLQ@mail.gmail.com>
> The main semantic question is whether callable/closure types should be defineable inline, or only as a reference (as in Rowan's C# example above.)  In the past, there's been non-small pushback to defining them inline, as that can make for very hard to read function declarations and if the same signature is used in multiple places, you have to manually keep them in sync.

I don't think function types should receive special treatment allowing
them to be defined outside as an alias. Complex type hints will start
appearing more frequently as we continue to expand the type system.
the solution is clear: type aliases. Until those land, i don't think
any non-inline/reference solution for a specific type should happen
tbh.

Cheers,
Seifeddine.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.