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.0 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 | PHP 8.0 | PHP 8.1 | PHP 8.2 | PHP 8.3 | |
benchmark.php | 242,9ms | 236,8ms | 188,5ms | 183,5ms | 181,9ms | 178,1ms | 174,1ms | 168,6ms | 166,8ms |
speed increase compared to the previous version (milliseconds) | – | 6,1ms | 48,3ms | 5ms | 1,6ms | 3,8ms | 4ms | 5,5ms | 1,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,1ms | 70ms | 21,7ms | 16,7ms | 15,1ms | 11,3ms | 7,3ms | 1,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
- Does php 8.3 is faster than other versions? - September 18, 2024
- Site infection – first remedial steps - August 22, 2024
- DMARC – changing configuration - December 6, 2023