PHP has matured greatly since version 5, especially in terms of performance, and Drupal 8 is a top choice for creating enterprise-level APIs. Neither is dead and Drupal is only "terrible" for beginners.
By most measurements, PHP is used by a majority of sites on the internet. The worst part is how many of those still use PHP 5, which reaches end of life tomorrow...