Why is this PHP temp file creation risky?

Why is this PHP temp file creation risky in a report worker. The PHP code writes to a predictable path in /tmp, which can be hijacked with symlinks. In PHP servers this can overwrite sensitive files.

#whatswrongwiththisphpcode #phpbug #phpproductionbug #phpdebugging #phpbackend #phpcodereview #phpsecurity #phpperformance #phpreliability #phpapi #phpwebdevelopment #phpengineering #phptempfile #phpsymlinkat...

https://www.youtube.com/watch?v=e4JN1Py5Kuw

Why is this PHP temp file creation risky? #phpcodereview

YouTube