Re: RFC: Support Closures in constant expressions

From: Date: Wed, 30 Oct 2024 11:43:10 +0000
Subject: Re: RFC: Support Closures in constant expressions
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-125879@lists.php.net to get a copy of this message
On 10/30/24 9:31 AM, Alexandru Pătrănescu wrote:
Hi Tim, So, why not allow capturing, since anyway the only place to capture are constants and static variables? And this way we could have short closures with auto-capture. If there are some technical reasons for not doing that, can we have written in the RFC? Alex
You don't need to capture constants or statics at all since they're all globally accessible (Well, except protected/private ones but that would require assuming a scope at compile time which is probably a bad idea)

« previous php.internals (#125879) next »