Modern java on a recent jvm (>=17) is incredibly scalable in comparison.
However.
I've spent many years doing PHP and Java-based development. Often times in parallel, having PHP projects on the side and earning money in Java development.
At some point, I had a stint of several years doing exclusively PHP-based work.
Every single time, my PHP projects were serving orders of magnitude more people orders of magnitude cheaper than Java-based projects.
And when I say "orders of magnitude", it is not an exaggeration but sad truth.
I am now in the Java land again, because pay is better. My current project has already burnt several millions serving 20 secretaries that handle 1000 individual cases each year.
My mind is with the PHP project I sold several years ago when it was serving 120,000 people at the cost of a few hundred euros per year + my labor, which was essentially free, but if I could slap my usual daily rate on it, it would still be somewhere between 20,000 and 30,000€/year.
I have heard a lot of praise for both laravel and php and I still reserve judgement, but since trying it out I take all the performance claims one way or another with 100% my daily recommended intake of salt.
Java, Ruby, C#, etc are application servers and this massively complicates everything.