What's wrong with this PHP Closure capturing loop variable?

What's wrong with this PHP Closure capturing loop variable by reference. The PHP code creates closures in a loop that capture the same variable. In PHP async all callbacks see the final value.

#whatswrongwiththisphpcode #phpbug #phpproductionbug #phpdebugging #phpbackend #phpcodereview #phpsecurity #phpperformance #phpreliability #phpapi #phpwebdevelopment #phpengineering #phpclosure #ph...

https://www.youtube.com/watch?v=4NcVI6-3C9Q

Whats wrong with this PHP Closure capturing loop variable? #phpsecurity

YouTube