> Particularly, if we could assume that nested functions automatically and properly capture the arguments to the parent function.
well, how would you do that ?
well, how would you do that ?
IIRC Rust uses capture modifiers similar to C++.
PHP closures have to specify which variables they close over, and whether it's done by-val or by-ref [0].
Nowadays there's also a shorthand single-expression-closure syntax that closes implicitly and by value [1].
[0]: https://www.php.net/manual/en/functions.anonymous.php#exampl...