A PHP internals mailing list discussion proposing typed closure signatures in PHP, e.g. Closure(int, string): array. The author acknowledges prior failed attempts — Callable Prototypes (declined 2016) and two 2023 draft RFCs on structural typing for closures and closures implementing interfaces — and asks whether the topic is still worth pursuing. One respondent points to a functional interfaces RFC that was also rejected, while another suggests waiting for generics to make Closure a generic type instead.

3m read timeFrom externals.io
Post cover image
46 Impressions