That was the hardest part of learning PHP, all the code examples online were just awful.
Certain popular PHP codebases appear to use a similar methodology.
So much copy/pasted code, some of it REALLY bad, and PHP has a lot of foot-guns that can lead to RCE.