There is a HUGE advantage to using the same language in the browser and on the server, and PHP isn't ever going to displace JavaScript in the browser. So JavaScript it is. That ship sailed a LONG time ago.
There is a HUGE advantage to using the same language in the browser and on the server, and PHP isn't ever going to displace JavaScript in the browser. So JavaScript it is. That ship sailed a LONG time ago.
And in what concerns validation, it can be automated on most frameworks, which has to be done on server side anyway due to security concerns.
When people get what is peanuts in local currency of the owner company, whatever they are using doesn't matter and most sweet shops are experts in everything.
I can also tell that at the level I work on, salaries are the same regardless of FE, BE, DevOps, ...., specially because no one has a single role.
The point is it takes fewer people (or even the same person) to write less code (instead of writing everything twice, then trying to keep them in sync forever).
There's a fascinating deep discussion about SveltKit and other frameworks here:
Reacting To Web Hot Takes from Rich Harris - SVELTE STUFF
I much prefer not having to write JavaScript everywhere, not every problem is a nail and not every solution requires a hammer.
You can simply compile your PHP code to wasm with emscripten, and then run it in the browser. Pretty straightforward. No more switching gears.