InstanceOfMichael Depends on the task -- and the code. Sadly a LOT of benchmarks seem to be intentionally written to highlight PHP's shortcomings or just have plain bullshit numbers.
PHP falls flat on its face in multithreading performance, numeric calculations due to the lack of strict typecasting, array performance, and most of the same failings common to every interpreted language; This is evident if you look at most Mandelbrot comparisons where they STILL show the same results in PHP 7.1 as they did in PHP 5.1 -- some 100 times or more SLOWER than Java -- THAT should be setting off your bullshit alarm on a benchmark when comparing PHP 5.x to PHP 7 we see a four to eight times speed difference twixt them. You strip out the threaded component in both languages suddenly PHP is giving Java a run for its money.
But that's like the bullshit excuse people used with PHP for AGES that the "real" bottleneck was the SQL side of things -- if that were true then how does PHP 7 deliver double the performance in Drupal, Magento, Laravel and Turdpress?!? Could it possibly be that people making said claim were full of ****?!?
A lot of benchmarks also being flawed in this idiotic tendency to run X number of tests and see how long it takes -- introducing timer granularity errors and other woes to the result that could be avoided if you just waited for timer rollover then ran the tests until X amount of time elapsed. See 99%+ of JavaScript benchmarks that are total BS in their results. (particularly when the comparison difference is below the timer granularity or code-order related)
PHP excels at what it's always excelled at, interfacing to a host server, string handling, talking to databases and outputting markup.
Dealing with markup in Java? IMHO it's a nightmare and a half with it not allowing for whitespace neutral strings in the code and REALLY being unsuited to console type output. If I was going to put up with that on a server-side project I'd say screw it and use a compiled language like C or Pascal.
I actually wrote a Pascal pre-processor who's sole purpose is to give it whitespace preserving multi-line strings.
The big change coming though is the JIT compilation branch, which eliminates a LOT of PHP's failings, doubling again the language's speed from what 7.x already provides. Makes Ruby, Python, and Perl look like they're standing still.
In the same way V8 and Quantum are taking JavaScript to performance levels I never thought we'd see... even if Quantum is "cheating" by resorting to pervasive multi-threading and offloading to the GPU instead of optimizing their bloody codebase... which is why on a multi-core system with a powerful GPU Quantum kicks Chromium's backside, but you drop to a single or even dual core with integrated and Quantum behaves WORSE than FF 56 did.
Thankfully MOST single and dual core systems have been on their way out the door for some five or six years now.