@sadaek is right on the money. These are exiciting times for PHP. While the language itself is horrendous, take a look at the frameworks that run on top of it. Symfony, Composer,... Albeit, with their flaws are excellent tools which keep developers from reïnventing the wheel as far as the low level stuff (session storage, file handling, request routing,...) is concerned. Writing your own mini CMS/F might be exciting, but today, don't even think about pushing them beyond your own personal projects. It's just plain redundant to do that.
It's also all about the sort of tool you need to get the job done. Wordpress is a blogging tool with a history. It's internals are a pile of steaming excrement, I agree. Yet, the front end is great for users and with a few clicks, you can easily set up a blog. But don't start to build entire platforms on top of it. It's just not meant to do that.
I do agree that the low level functions of PHP are a mindfart. Having said that, you can still map your findings here: https://bugs.php.net/ Mind you though, PHP's biggest issue is its' legacy. Powering the Web comes at a cost: you can't just start rummaging around at the low level without breaking all those hacks people have written over the years. It's probably just cheaper to leave those in. If Python had the same success, we'd probably be taking a dump on typical Pythonesque monstrosities that we don't even care about the slightest bit today.

Look at this incredible thing Ian Baker created. Look at it! What you're seeing is not Photoshopped. This is an actual photo of a real world, honest to God double-clawed hammer. Such a thing exists. Isn't that amazing? And also, perhaps, a little disturbing? That wondrous hammer is a de...