Comment Comment by DCoder > I don’t know any other language with lambdas which requires me to spell out explicitly which variables it should close overPHP 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...[1]: https://www.php.net/manual/en/functions.arrow.php parent DCoder 6 years ago
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...
[1]: https://www.php.net/manual/en/functions.arrow.php