Ok. Let's get this straight. PHP is not dead. It's not going to die anytime soon. Why? PHP released a new version recently (actually just a few months ago). It exists in more than 80% of all websites. It’s also used actively by millions of developers. None of that will disappear out of thin air.
Despite the fact that many new languages flourish every year, I would not hesitate to say that PHP (besides JS) is one of the safest languages in the world in terms of jobs, and will securely guarantee an enormous job market around the world for much longer than 5 years. Here is why.
PHP adopts new ideas slowly. It may sound like a weird reason for a programming language to keep up with the contemporary development trends. In fact, what happens is only proven, polished and time-checked ideas find their way into PHP.
PHP has low entry level. This means that it is one of the easiest languages to start coding for newbies ever. Then, once it is adopted by newbies, it often turns out that this language is enough for a lot of people that do not need genius, complex, mathematical and scientific features. Result - they just keep using PHP.
Big platforms and companies which use PHP make lots of money every day! WordPress, for example, which is made in PHP, is a free framework, but WordPress.com is a commercial WordPress hosting and makes money out of it. Then, there are tens of others like it. Now multiply this business volume by the number of other big PHP projects, like shopping carts, CRMs, issue tracking systems, web analytics...
And one of the biggest reasons...
Servers accessibility. The cheapest servers / VPS for web projects always support PHP. PHP has one of the lowest minimum requirements to the memory / processor speed.
Is PHP on the decline? Yes. But that doesn’t mean it’s going away any time soon.
Consider COBOL. An almost sixty year old language that’s horrible by modern standards and has been on the decline for thirty years. Yet it runs our financial infrastructure, and there are still an estimated one million COBOL developers worldwide. Maybe that is what PHP will be like in a couple of decades.