A PHP RFC (targeting PHP 8.6) proposes two closure optimizations: automatic static inference for closures that don't use `$this`, and caching of stateless closures between uses. The static inference eliminates implicit reference cycles between closures and their parent objects, reducing garbage collection pressure. Closure
Sort: