[RFC] Scope functions

From: Date: Wed, 06 May 2026 20:09:45 +0000
Subject: [RFC] Scope functions
Groups: php.internals 
Request: Send a blank email to internals+get-130786@lists.php.net to get a copy of this message
Volker and I drafted a RFC: https://wiki.php.net/rfc/scope-functions Please consider it and share your feedback. I hope it will alleviate pain around some of the most common forms of Closure usage which is "execute this now as part of the called function", which currently can require a lot of "use ($variables)". For me the primary use case of use ($capturing) was always "I need this function later and want to explicitly document what escapes my function". This, however, required this straightforward usage of Closures to also document every single usage of a variable. Which is really not that beneficial at all. Thus the scope functions as proposed will be able to fill that gap in future. Thank you, Bob

« previous php.internals (#130786) next »