
PHP 5.6 vs. PHP 7 Performance Comparison - ped4enko
https://gbksoft.com/blog/php-5-vs-php-7-performance-comparison/
======
SiempreViernes
> You may already know that PHP, C++, Swift, and any other modern programming
> language is not communicating directly to the hardware. The programming
> language is just an easier way to talk to the machine. The machine native
> language is still binary code.

> One way or another, each programming language is translated to the binary
> code by using the compiler. PHP is no different. But what makes it unique is
> a Just in Time engine, that allows compilation of the code during the
> execution of the program. This principle is also known as dynamic
> translation.

I mean, I guess this weird explanation is fine for a php consultant, but
honestly I wouldn't trust any results presented next a description this wrong.

~~~
throwaway2016a
The first part is kind of baffling. I'm not even sure what is trying to be
said there. English as a second language?

The second one if actually wrong unless something changed very recently, PHP
is not JIT compiled (at least not to machine code). It is a bytecode VM. I
remember the discussion came up and optimizing the byte code was actually
improved performance more than proof of concept JIT did for common PHP use
cases.

PHP 8 is supposed to have a JIT I believe.

------
maaaats
Not to be overly dismissive, but this article is just... weird?

The arguments for why switch are pointless, no mention of the actual benefits.
Statements like "Hopefully, JIT was integrated into PHP 7", and a very special
explanation of compilation and jit. It makes me not trust anything written
here.

~~~
NightlyDev
The person writing this has no idea about what he's talking about, so you're
not the only one finding it untrustworthy.

Seriously, how can a person call himself a "PHP guru" and at the same time
tell people that it's faster as a result of JIT compilation when PHP doesn't
use JIT compilation? Amazing.

------
bernarpa
<<Need a consultation of PHP developmer? CONTACT GURU OF PHP!>>

~~~
SiempreViernes
He can also write your web services in runtime interpreted C++!

------
NightlyDev
"JIT was integrated into PHP 7, which is why it has almost the same results as
HHVM."

"PHP guru"

PHP doesn't use JIT compilation...

~~~
blowski
HHVM does have JIT, but you're right that PHP 7 does not. Maybe they were
thinking about the AST. Anyway, it looks like they've corrected the article.

------
gregoriol
This article is non-sense from a technical point of view: there are so few
details on what is tested, on which conditions, ...

There for example is no mention of the php7 version tested: 7.0? 7.1? 7.2? No
version of hhvm either. No clear details on what the tested code does: what
kind of setup/options is used, which Wordpress page(s) is actually called. How
much memory the machine has, how php is configured regarding the opcache, ...

Also, why posting this to HN now? Php 7 has been released more than 2 years
ago, those improvements have been discussed a long time ago.

------
dreistdreist
Spaceship operator is mentioned, but nothing about the much improvemed type
declarations?

------
blowski
Personally, I've found the biggest performance improvement comes with
instantiating classes. I don't understand the internals well enough to
explain, but in profiling, I've always seen significant improvements.

------
chinathrow
Not sure why people are still comparing towards PHP 5.6 as that version is
slated for EOL later this year.

[http://php.net/supported-versions.php](http://php.net/supported-versions.php)

~~~
pasta
Because in the hosting world this is still one of the dominant versions.

------
bkovacev
can't access - HN hug of death?

~~~
bartkappenburg
OT: do they run on 5.6 or 7? ;-)

~~~
remote-work
Looks like .NET site :- )

------
remote-work
The article's website does not load for me with CloudFlare DNS (1.1.1.1)

