Re: Closure::getCurrent() for recursion

From: Date: Tue, 01 Apr 2025 10:40:05 +0000
Subject: Re: Closure::getCurrent() for recursion
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi

Am 2025-04-01 12:32, schrieb Morgan:
This is just as effective as it would be for any use()d variable, so why do we have use() again?
If you are at the point where you need mutually recursive closures, perhaps you should just use named functions / an anonymous class. I don't find it useful to “optimize DX” for that case, since self-recursive Closures are already somewhat questionable / rarely used (though I think I've used that myself a handful of times in the past). Best regards Tim Düsterhus

Thread (15 messages)

« previous php.internals (#127003) next »