Here I run the PHP benchmark script on my Virtualbox guest OS Ubuntu 16.04.

Every version of PHP I tested 7 times. So get rid of the highest one, and the lowest one. Get the average of the rest five scores.

php5.6.39
The average is 5.13 seconds.

--------------------------------------
|        PHP BENCHMARK SCRIPT        |
--------------------------------------
Start : 2018-12-20 17:49:49
Server : t.g2list.win@192.168.1.120
PHP version : 5.6.39-1+ubuntu16.04.1+deb.sury.org+1
Platform : Linux
--------------------------------------
test_math                 : 1.523 sec.
test_stringmanipulation   : 1.594 sec.
test_loops                : 1.147 sec.
test_ifelse               : 0.808 sec.
--------------------------------------
Total time:               : 5.072 sec.

php 7.1.25
The average is 1.859 seconds.

--------------------------------------
|        PHP BENCHMARK SCRIPT        |
--------------------------------------
Start : 2018-12-20 17:41:51
Server : t.g2list.win@192.168.1.120
PHP version : 7.1.25-1+ubuntu16.04.1+deb.sury.org+1
Platform : Linux
--------------------------------------
test_ifelse               : 0.517 sec.
test_loops                : 0.378 sec.
test_stringmanipulation   : 0.561 sec.
test_math                 : 0.389 sec.
--------------------------------------
Total time:               : 1.845 sec.

php7.2
The average is 1.286 seconds.

--------------------------------------
|        PHP BENCHMARK SCRIPT        |
--------------------------------------
Start : 2018-12-20 17:44:37
Server : t.g2list.win@192.168.1.120
PHP version : 7.2.13-1+ubuntu16.04.1+deb.sury.org+1
Platform : Linux
--------------------------------------
test_ifelse               : 0.164 sec.
test_loops                : 0.274 sec.
test_stringmanipulation   : 0.495 sec.
test_math                 : 0.336 sec.
--------------------------------------
Total time:               : 1.269 sec.

php7.3
The average is 1.31 seconds.

--------------------------------------
|        PHP BENCHMARK SCRIPT        |
--------------------------------------
Start : 2018-12-20 17:47:16
Server : t.g2list.win@192.168.1.120
PHP version : 7.3.0-1+ubuntu16.04.1+deb.sury.org+1
Platform : Linux
--------------------------------------
test_ifelse               : 0.181 sec.
test_loops                : 0.350 sec.
test_stringmanipulation   : 0.469 sec.
test_math                 : 0.323 sec.
--------------------------------------
Total time:               : 1.323 sec.

I do have to say that the tests I run is not good enough. It does’t test all the php features. Actually, it is just a very small part of it.
If you count on the database, memory usage, etc., the answer will be quite different.

David Yin

David is a blogger, geek, and web developer — founder of FreeInOutBoard.com. If you like his post, you can say thank you here

Leave a Reply

Your email address will not be published. Required fields are marked *