PHP is great when you use it right. The problem is, most people don’t use it right. That old way of rendering html through PHP, or worse, injecting PHP into html, is antiquated.
IMO, PHP is a great language to use for making your backend API. Use whatever flavor of the week on your front end.