Of course you can write good code in modern PHP, but you can write really bad stuff too - more (at least imho) than in other popular languages. And then the whole ecosystem "drags you down" and gives PHP a bad rep -> but I don't think it's totally undeserved.
On a similar note, this actually compelled me to try Rust/something similar instead of just going straight back to Python (which I still love tbh).