The year 2021 has been highly eventful for PHP (and Kinsta). PHP 8.0 is already a year old, and the much-anticipated PHP 8.1 was released on November 25, 2021, bringing many exciting features. You can catch up on all the latest PHP 8.1 features in our in-depth post. Show
Each year we release our in-depth performance benchmarks for various PHP platforms to see how different PHP versions stack up against each other. This year, we benchmarked 5 different PHP versions across 14 unique PHP platforms/configurations, including WordPress, Drupal, Joomla, Laravel, Symfony, and many more. We also tested other popular PHP platforms such as WooCommerce, Easy Digital Downloads, October CMS, and Grav. At Kinsta, we always encourage using the latest supported PHP versions. Not only are they the most secure, but they also offer many performance improvements. Today, we’ll show you how PHP 8.0 and 8.1 stand tall against almost everything we put them against. Are you excited? Let’s start! The State of PHPPHP (recursive acronym for PHP: Hypertext Preprocessor) is one of the most widely used server-side scripting and programming languages. It is open source and used predominantly for web development. And since PHP powers a bulk of the core WordPress software, it’s a highly essential language for the WordPress community. PHP logo.While some may suggest that PHP is dead, it’s far from the truth. As per W3Techs, PHP is used by 78.1% of all websites whose server-side programming language they know. That’s almost 4 out of 5 websites! View plans PHP is much alive, faster, and better than ever. PHP sits at the very top of server-side programming languages.If that looks dead to you, we’d like to know what’s considered alive! Even when compared with JavaScript and its new server-side implementations, PHP stands tall and proud beside it. However, there’s a big problem with the PHP community. Many websites are still using outdated versions and unsupported PHP installations. According to W3Techs, 29.9% of websites are still on PHP 5.6 and lower. WordPress PHP versions (as of February 01, 2022).And when it comes to WordPress stats, only 50.6% of the sites are running on supported PHP versions. What’s even worse is that 10.2% of all WordPress sites run on PHP 5.6 or lower. It’s better than the overall PHP community, but many websites have their backdoors wide open. We think there are many reasons for this conundrum:
Kinsta follows the same end-of-life (EOL) schedule as PHP to beat this troubling issue. It helps keep all the WordPress sites hosted with us as fast and secure as possible. How do Kinsta customers stack up against the general WordPress community? We were curious ourselves, so we took a look at the numbers. Here’s the rundown:
*As of December 1st, 2022. We’re proud and excited about these stats. It means the PHP adoption rate among Kinsta customers is much higher than the general WordPress and PHP community. And that makes us mighty happy! Note: PHP 8.0 brought many breaking changes, so many users haven’t shifted to it yet. However, we expect more sites to shift to it soon. If you’d like to , we’ve compiled a list of some excellent PHP tutorials (both free and paid). PHP Benchmarks (2023)Though PHP 7.2, 7.3, and 7.4 aren’t actively supported, many websites are still running on them. Hence, we decided to test five different PHP versions so that you can see just how impressive the newer PHP versions are in terms of performance. This year’s hot pick is, of course, the newly released PHP 8.1. It’s the latest and the most exciting development in the PHP world, and for a good reason. Not all PHP-based frameworks and CMS fully support it yet, but we’ve tested as many of them as possible. We used the latest version of each platform for each test and benchmarked one of its URLs with 15 concurrent users for 1,000 requests. We benchmarked multiple times to ensure the results were consistent. Furthermore, we considered the average of only the top 3 results. You can find details of our test environment below:
As OPcache improves PHP performance by storing the precompiled script bytecode in the server’s shared memory, it eliminates PHP’s need to load and parse scripts for each request. PHP Platforms and Configurations TestedOur benchmarks include the following 14 PHP platforms/configurations. Click on any of them below to skip directly to its test results and notes. We measured the data in requests per second. The more requests, the better. As the demo content across each platform can vary dramatically, we tested their barebone installations’ raw performance. The goal here is to benchmark various PHP versions — the CMSs and frameworks only serve as a tool. You shouldn’t use these benchmark results to weigh one platform against another, but how it competes against itself on different PHP versions. We’ve also included their size and screenshots to give you a better idea of the pages tested. Some are small, while others are huge. Without further ado, let’s dig in! WordPress 5.9-RC2WordPress was the first platform we tested. After all, it powers this very blog you’re reading and 43.3% of all the websites on the internet. It’s a free and open source software you can use to create beautiful websites, blogs, and apps. We started with WordPress 5.9-RC2 (Release Candidate 2), the latest version when benchmarking for this article. It comes with the new Twenty Twenty-Two theme installed. We benchmarked the URL for 1000 requests with 15 concurrent users. The same methodology was used for all the other tests. The tested WordPress page.URL Tested:
InfoThe benchmark data is measured in requests per second. The more requests, the better. WordPress 5.9-RC2 PHP Benchmarks.Benchmark Results
PHP 8.1 is the clear winner here, proving 47.10% faster than PHP 8.0. That’s a surprising standout here, considering how close all the other results are. And if you compare it to PHP 7.2, it can handle more than 50% requests (or transactions) per second. ImportantThe state of PHP 8.1 support in the broader WordPress ecosystem (plugins, themes, development tools, etc.) is almost impossible to know. If you’re planning to upgrade a production or mission-critical site’s environment to PHP 8.1, please test thoroughly beforehand to ensure that it doesn’t break. WordPress on PHP 8.1 can handle 47.10% more requests per second than PHP 8.0. Make sure you update today! 🤘🏽🚀Click to TweetWordPress 5.9-RC2 + WooCommerce 6.1.1WooCommerce is an open source ecommerce solution for WordPress. Unlike other popular ecommerce platforms, it’s fully customizable and extensible. WooCommerce is also one of the most popular ecommerce plugins in the WordPress community, powering on the internet. For our next test, we installed WooCommerce on top of WordPress. We used the free Storefront theme and WooCommerce’s default data to set up the test site. The URL tested is a single product page. The tested WooCommerce page.
Benchmark Results
PHP 8.1 is the clear winner for WooCommerce too. It beat out PHP 8.0 by a small margin. Your WooCommerce store running on PHP 7.2 is 11.47% slower than your competitor's store on PHP 8.1! Make sure you upgrade ASAP! 🛒🚀Click to TweetWordPress 5.9-RC2 + Easy Digital Downloads 2.11.4.1Easy Digital Downloads is a free ecommerce plugin for WordPress. Created by Pippin’s Plugins (now owned by Awesome Motive), it’s focused entirely on helping you sell digital products (e.g. ebooks, software, videogames). For Easy Digital Downloads, we used its free Themedd theme and its default content to set up the test site. The page tested is a single product page. The tested Easy Digital Downloads page.
Benchmark Results
At the time of benchmarking, the latest EDD version didn’t support PHP 8.1 yet. Like the previous year’s benchmark, PHP 8.0 outshines all the other PHP versions with WordPress and Easy Digital Downloads. InfoPHP 8.0 and 8.1 have proven to be faster across the board when it comes to WordPress, WooCommerce, and Easy Digital Downloads. If you’re using WordPress to run any of your sites, you should plan to shift to PHP 8.0 and above ASAP. Drupal 9.3.3Drupal is a free and open source content management software. It’s popular for its flexible and modular features. According to W3Techs, Drupal is used by 1.3% of all websites, including 2.0% of the websites using a content management system. We installed Drupal with its Umami installation profile, a demo food magazine website that demonstrates Drupal’s core features. The tested Drupal page.
Benchmark Results
Drupal 9.x.x has come a long way since we last benchmarked it. Not only is it compatible with newer PHP versions, but it also performs exceptionally well. We’re excited to see how it evolves going forward! Joomla! 4.0.6Joomla! is another free and open source content management system. It was first released in 2005 and is the second-most popular open source CMS in use today. According to W3Techs, Joomla! is used by 1.7% of all websites they track. For the Joomla! benchmark, we used the free Cassiopeia template that ships with all Joomla! 4.x distributions. The tested Joomla page.
Benchmark Results
After some hiccups, Joomla! is back on track. The results follow an expected pattern here — PHP 8.1 is the undisputed champion, closely followed by PHP 8.0, and then the rest. Grav 1.7.29is an open source flat-file CMS. It doesn’t require a database to operate, yet it’s rich in features. Grav queries content from text files. That makes it lightweight and easy to install on almost any server. When performing this test, Grav required PHP 7.3 and above to work. We used the Base Grav Package that provides a default landing page for the test. Deploy your application to Kinsta - Start with a $20 Credit now.Run your Node.js, Python, Go, PHP, Ruby, Java, and Scala apps, (or almost anything else if you use your own custom Dockerfiles), in three, easy steps! Deploy now and get $20 offThe tested Grav page.
Benchmark Results
PHP 8.1 is the undisputed winner with Grav, closely followed by PHP 8.0 and the rest. Being a relatively new CMS, it has a smaller market share than WordPress. Hence, it can drop support for older PHP versions quite quickly. That’s one of the most significant advantages of modern CMSs. OctoberCMS 1.3.1OctoberCMS is a CMS based on the Laravel PHP framework. Originally free and open source, OctoberCMS is now a paid platform after changing its licensing model in 2021. It’s popular amongst developers to make dynamic websites using the power of Laravel. As per W3Techs, OctoberCMS powers just 0.1% of websites. We used OctoberCMS’s default demo theme for the test site. It’s a responsive theme with a well-defined layout.
Benchmark Results
PHP 8.0 is the clear winner here. OctoberCMS handled 20.16% more requests per second on PHP 8.0 than on PHP 7.4. We’re eager to see how its next major update performs on PHP 8.1. Laravel 8.80.0Laravel is the most popular PHP framework as of today. Created by Taylor Otwell, it was released in June 2011. You can use Laravel to develop almost any web application, including CMS, ecommerce sites, apps, and much more. We used the default Laravel landing page to benchmark Laravel. As Laravel founder Taylor Otwell has pointed out before, you shouldn’t use these benchmark results to compare Laravel with other PHP frameworks. The goal here is to see how Laravel performs on different PHP versions when everything is constant. The tested Laravel page.
Benchmark Results
It’s nice to see that Laravel supports the latest PHP version. PHP 8.0 is the undisputed champion with Laravel, while PHP 8.1 came in last. There’s some room for improvement here. Perhaps the just released Laravel 9 may throw up interesting results, but that’s for our next benchmarks. Symfony 5.4.2Symfony is a set of reusable PHP components and a PHP framework to build web applications, APIs, microservices, and web services. It’s a free and open source software and was released on October 22, 2005. Though Symfony has released its 6.x version, it only supports PHP 8.0 and above. Hence, we decided it’s more apt to use its latest 5.4.2 version to benchmark PHP. You can install Symfony with a demo application. It’s a reference CMS app that demonstrates how to best use Symfony and its various features. We used the homepage from this demo application to benchmark Symfony. The tested Symfony page.
Benchmark Results
With Symfony, there’s a massive difference between PHP 8.1 and the rest. For instance, Symfony runs 20.65% faster on PHP 8.1 than PHP 7.4. Tired of a slow host? Kinsta is built with speed and performance in mind. Check out our plans Symfony on PHP 8.1 can handle 20.65% more requests per second than PHP 7.4 ⏩⚡Click to TweetCodeIgniter 4.1.8CodeIgniter is a PHP framework with a tiny footprint. For instance, its latest version is a 1.2 MB download. It’s created by EllisLab and fostered by the British Columbia Institute of Technology. You can still use CodeIgniter to develop full-featured web apps despite its size. For benchmarking CodeIgniter, we set up a demo application using their official tutorial. It uses a basic HTML theme and outputs many “News” items. The tested CodeIgniter page.
Benchmark Results
PHP 8.1 is the fastest with CodeIgniter, performing 8.48% more requests per second than PHP 8.0. However, it was surprising to find PHP 7.4 performing way better than PHP 8.0 — it’s almost on par with PHP 8.1. CakePHP 4.3.4CakePHP is an open source web framework for developing PHP applications. It promises to make building web applications simpler, faster, and less code. To benchmark CakePHP, we used its default landing page. We connected it to a database before benchmarking. The tested CakePHP page.
Benchmark Results
Surprisingly, PHP 8.0 takes the cake with CakePHP. However, all the benchmark results are too close to call a definite winner. PHP 8.1 is just 5.6% slower than PHP 8.0. Future updates to CakePHP 4.3.x may solve this discrepancy. Craft CMS 3.7.30.1is an open source content management system focused on user-friendliness. Its backend is entirely customizable. With a built-in tool to design custom field layouts for different content types, Craft CMS also makes it super simple to work with custom content types. If you’re planning to create a custom ecommerce store, check out Craft Commerce. And for a local development environment for Craft CMS, there’s also Craft Nitro. For the Craft CMS benchmark, we used its default admin login page. It’s a simple login page that includes a login form to access the site’s backend. The tested Craft CMS page.
Benchmark Results
PHP 8.1 took the top spot with Craft CMS. Unlike our previous benchmarks, Craft CMS now supports both PHP 8.0 and PHP 8.1 — that’s great! Kirby 3.6.1.1Kirby is a flat-file CMS focused on content creation and publishing. While its source code is available publicly, it’s not free to use on a public server. You can customize your editing interface with forms, articles, galleries, spreadsheets, and more with Kirby. You can install Kirby with a Starterkit, which sets up a fully functional demo site. We used its About Us page for this benchmark. The tested Kirby page.
Benchmark Results
PHP 8.1 hit it out of the park with Kirby’s benchmarks. It’s also worth mentioning that Kirby handled most requests per second across all the PHP platforms we tested. Even though it’s an apples and oranges comparison, that is still something to live up to. Its main drawback is that it’s not free to use. Flarum 1.2.0Flarum is a free and open source forum software for online discussions. You can install Flarum with a demo site. We also added three threads with a few paragraphs of text. The tested Flarum page.
Benchmark Results
Flarum is a new entrant in our PHP benchmarks. Since it’s a popular PHP forum software, we were excited to test it out and see how it performs. While PHP 7.4 performed the best with Flarum, it’s almost the same on all the other PHP versions we benchmarked. Update to PHP 8.1 at KinstaPHP 8.1 introduced a lot of exciting features. Some of them are radical, breaking changes that aren’t compatible with the previous PHP versions (mainly <PHP 8.0). There’s no reason you shouldn’t update to PHP 8.1 if all your website’s features work fine on it. If the above results don’t convince you yet, we aren’t sure what else will! As a friendly reminder, all Kinsta clients can use PHP 8.0, 8.1 with our custom self-healing database configuration. Kinsta supports PHP 8.0 and 8.1.And if you’re worried about breaking your site due to incompatibilities with a third-party plugin (which can happen), we have staging sites 👍 You can use our staging sites feature to test away endlessly without worrying about breaking your production site. Once you’re sure that everything works perfectly, you can push the changes live with the press of a button. Takeaway From PHP Benchmark ResultsThe compiled PHP Benchmarks.From the benchmark results above, you can see that PHP 8.1 leads the pack in most PHP platforms and configurations, closely followed by PHP 8.0. Here’s our extended takeaway from the PHP benchmark results:
It was a blast benchmarking all the various PHP platforms. We’re mighty excited about PHP 8.1. We hope you are too! If you have any thoughts regarding our benchmarks or experiences with upgrading PHP versions, we’d love to hear them. Drop them below in the comments! Get all your applications, databases and WordPress sites online and under one roof. Our feature-packed, high-performance cloud platform includes:
Test it yourself with $20 off your first month of Application Hosting or Database Hosting. Explore our plans or talk to sales to find your best fit. Apa Kelebihan PHP 8?Beberapa fitur utama yang ditawarkan oleh PHP 8 beserta fungsinya adalah sebagai berikut: Just In Time Compiler – meningkatkan kinerja program yang diinterpretasikan. Weak Maps – membersihkan objek yang sudah tidak direferensikan. Union Type – memungkinkan Anda mendeklarasikan variabel dalam beberapa tipe.
PHP sekarang versi berapa?Saat artikel ini ditulis, versi PHP terbaru adalah PHP 8.1 yang dirilis 25 November 2021. PHP 8.1 punya beberapa fitur baru antara lain Readonly Properties dan Never Return Type.
Apa itu PHP versi 7?PHP 7 adalah rilis utama dari bahasa pemrograman PHP dan ini disebut-sebut sebagai sebuah revolusi dalam cara aplikasi web dapat dikembangkan dan dikirim untuk mobile untuk enterprises and the cloud. Rilis ini dianggap menjadi perubahan yang paling penting untuk PHP setelah pelepasan PHP 5 pada tahun 2004.
|