I would argue they both have advantages. JavaScripts golden trump card is that it runs in the browser and outside of ASM.js or wasm nothing else can.
While the PHP and backend programming is cleaner / easier, users and service providers have moved away from that world for good reason -- because a SPA UI feels snappier to an end user than a page refresh.