Re: [Discussion] Revisiting typed closures

From: Date: Thu, 02 Jul 2026 19:57:55 +0000
Subject: Re: [Discussion] Revisiting typed closures
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-131723@lists.php.net to get a copy of this message
> 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.

« previous php.internals (#131723) next »