I've been a professional programmer for over 30 years with some of the biggest companies in the world. I've worked with assembly, c, c++, c#, java, kotlin, perl, lua, haskell, rust, javascript, typescript, coffeescrpit, dart, php, python, and I'm sure 3 or 4 other languages I've just forgotten about at this point. Some of those languages are terrible and I hope never to touch again, others were great and I'd be happy to work with.
PHP should have been retired as a language 20 yeara ago, but WordPress has kept it alive all this time. The rest of the industry has moved on and learned lessons from what came before, but the sheer momentum of hundreds of thousands of WordPress installs has somehow kept PHP alive. The language started as a hack, and it remains a hack. It's gotten faster over the years, but it's still just as badly designed today as it was when it was originally created.