PHP has made some huge progress in the past couple of years with the release of 8.0 and 8.1 and their new features like named parameters
, constructor promotion
, match expression
, union return types
, readonly properties
, enums
, just to name a few.
The most important one in my opinion related to performance is JIT. I’ve been fascinated by this feature and how much it helps in the long run when dealing with some applications which require lots of resources and time to return a response.
That’s why I decided to do a performance benchmark to really understand the benefits in execution time by using one of the slowest and with time complexity of O(n²)
sorting algorithms like BubbleSort to sort an array with 10000 numbers.
I was fascinated by the results and the table alongside with the chart below will show you why.