The problem with PHP is that its had two eras of developers and both are kinda awful.
The first developer era (which I shamefully was a member of in the 1990s) where grossly incompetent, barely structured their code and filled their code with SQL injections , used magic globals and just made absolute horror shows. Thats the era that got PHP its bad rep. Mostly gone now. Wordpress however IS a relic of that era.
The second developer era overcompensated by basically going full java creating codebases with 20 level deep class heirachies, and all sorts of weird java patterns like dependency injection, inversion of control, delegates, blah blah blah, all that stuff that makes java "proper" but ends up leading to some very mystifying code that can be nightmarish to understand. Worse, it often deployed those methods in an attempt at replicating Ruby on Rails glory, creating mutants like Laravel that would take the bad features of ROR (like RORs awful ORM. Devs, if your going to steal an ORMs design, steal Djangos one, that thing is a minor miracle) but trying to implement them without the metacoding that makes Ruby fun and productive to with. Its just a mess. And even its "lightweight" web framework Laravel really does feel like a bloated enterprise thing now, and lets face it why would you do big cumbersome enterprise in PHP when Java and C# are RIGHT THERE.
PHP on its own isn't a bad language. Its got a lot of bad cruft in it, but its basic design largely is competent and featureful. But its ecosystem has turned it into a barely competent immitation of javaa and the worlds moved well beyond that in 2025.