My entire 20 year career is filled with wordpress blunders, i could never ever trust php again, ever ever ever, even if they said it has been reimplented by completely different people in every other language.
there is something about "theme" code leading to complete control of servers that is fundamentally broken in every way, there is no coming back from this reputation
I left Wordpress development in 2014 (I think?), and it's true that I always found it to be an abomination; but naturally so given it's a project with a long history.
That said: PHP isn't Wordpress. Honestly, look at a modern Symfony codebase. You'll find monads, functional programming, etc, at least that was my experience at the last PHP shop (in 2020).
there is something about "theme" code leading to complete control of servers that is fundamentally broken in every way, there is no coming back from this reputation