This post was inspired by having to pass around ReactPHP's event loop all day.
😑 Are you tired of managing loads of use (...)
constructs because you need some local variable inside a deeply nested closure?
🤯 Use the following tiny function abusing Closure::bind()
to bend variable scope to your will!
function run_scoped(Closure $callback, $init = [])