A huge reason PHP is so popular is because WordPress is incredibly popular. WordPress isn't popular because it's the best. Instead it's "good enough". And that probably remains true even if PHP continues to have security issues.
https://beta.buildcivitas.com/t/wordpress-is-better-because-its-worse/186