On Tue, Oct 29, 2024, at 10:11 AM, Tim Düsterhus wrote:
> Hi
>
> Volker and I would like to start discussion on our RFC to "Support 
> Closures in constant expressions".
>
> Please find the following resources for your reference:
>
> - RFC: https://wiki.php.net/rfc/closures_in_const_expr
> - Implementation: https://github.com/php/php-src/pull/16458
>
> Best regards
> Tim Düsterhus

This seems like a good idea to me.  My only real question is why we need to 
forbid short-closures.  I fully agree that capturing variables for such 
functions doesn't work.  What I don't understand is why that precludes 
short-closures.  Is it not possible to "just" say "there's nothing to even 
capture in this context, don't try"?  (There may be technical reasons for that, 
but I do not know what they are and the RFC doesn't say.)

--Larry Garfield

Reply via email to