Does php 8.3 is faster than other versions?

As of December 2023, the latest version of PHP 8.3 is running on our servers. It brings many changes, new functions and improvements – one of the latter is an increase in the speed of script processing compared to previous versions.

What is worth to know about php?

PHP – an interpreted programming language for generating/building web applications.
According to W3techs, as of September 10, 2024, php is used by approximately 75.9% of all websites on the Internet.
If the application supports the latest version of php, it is worth using it. Why it is worth using the latest version and how to change php in cPanel were described in an earlier entry.

What’s new in php 8.3

The most important changes in php 8.3:
-> Adding a new json file validation method – json_validate() method
-> Extension of the Randomizer class that allows you to generate random digits (introduced in php 8.2)
->Anonymous readonly classes
->Dynamic access to fixed classes
->Negative indexes in arrays

All new features introduced in php 8.3 can be found here.

Test environment

In order to compare the latest versions of PHP, we created an account in the premium-ssd–www package (recommended, among others, for online stores) on a regular server where customer accounts are created – currently it is an S56 machine – this is quite important information due to the fact that most tests that we have encountered so far were carried out in “laboratory” conditions, i.e. on websites created specifically for PHP testing. We, in turn, analyzed the operation of the scripts from the point of view of a normal user to make the results more reliable. We tested each script ten times and then averaged the results.

Tests

PHP 7.0PHP 7.1PHP 7.2PHP 7.3PHP 7.4PHP 8.0PHP 8.1PHP 8.2PHP 8.3
benchmark.php242,9ms236,8ms188,5ms183,5ms181,9ms178,1ms174,1ms168,6ms166,8ms
speed increase compared to the previous version (milliseconds)6,1ms48,3ms5ms1,6ms3,8ms4ms5,5ms1,8ms
speed increase compared to the previous version (%)2,58%25,623%2,72%0,88%2,13%2,3%3,26%1,079%
How much faster is php 8.3 (milliseconds)76,1ms70ms21,7ms16,7ms15,1ms11,3ms7,3ms1,8ms
How much faster is php 8.3 (%)45,62%41,97%13,01%10,01%9,05%6,77%4,38%1,079%

The above data can also be presented in charts:

Scripts used to perform the tests:

1)benchmark.php

The main task of this script is to perform standard operations on PHP and, optionally, on the database used by WordPress, Joomla, PrestaShop and other CMSs:

– calculating mathematical operations,
– operations on strings of characters,
– calling a loop,
– operations on if else conditional statements.

Source: https://github.com/vanilla-php/benchmark-php/blob/master/benchmark.php

Summary

As you can see, the latest version of php (8.3) is much faster than previous versions of php and is worth using it.
You can read how to change the PHP version and why it is worth doing it in one of our posts.

A new version of PHP 8.4 should be released at the end of 2024, which will probably allow for even better results. When php 8.4 will be available, we will perform further performance tests.

We encourage you to perform performance tests yourself and check the new features of PHP 8.3.

Order premium-ssd-www package and test it 14 days for free

Tomasz
Latest posts by Tomasz (see all)