What about PHP merits this statement? It's 2025, PHP has become modern, performant, and has good frameworks that are battle-tested and reliable. Yikes. (And this from a former PHP and now Node developer.)
It is not really suited for software which need to maintain long lived connections and that's the case with nextcloud when uploading or downloading large files.
It supports Websockets perfectly. Maybe you're conflating the issue with Apache's default settings, Apache being often the choice to front PHP servers?
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).
If you are okay with Rust or C# idk why Go is an issue? Go powers most infrastructure on the internet that we rely on. Docker, Kubernetes, Hugo, Caddy, MinIO, a lot of these are used in backend services so you would never even realize you are using them but you are. I think Go is fine.
I'd prefer Rust as well, but anything with a decent type system is okay. I have bad associations with Java software, but idk if that's the language itself, or enterprise brainworns.
Modern PHP is a strongly typed language, still dynamically typed, but in a way that feels more like static typing. Better than TypeScript for sure if you're not into PhD-level typing hacks, and light years ahead of Ruby, Python, JS, and their ilk.