{"id":15049,"date":"2021-01-04T11:53:48","date_gmt":"2021-01-04T11:53:48","guid":{"rendered":"https:\/\/www.accuwebhosting.com\/blog\/?p=15049"},"modified":"2025-09-15T13:58:00","modified_gmt":"2025-09-15T13:58:00","slug":"wordpress-php-8-compatibility-benefits","status":"publish","type":"post","link":"https:\/\/www.accuwebhosting.com\/blog\/wordpress-php-8-compatibility-benefits\/","title":{"rendered":"WordPress &#038; PHP 8 &#8211; Compatibility &#038; benefits!"},"content":{"rendered":"<p>Most of the tech-geeks are excited with PHP 8.0, and certainly, the changes are huge this time. everyone is going to consume some time to understand the compatibility, configurations, benefits, etc., of PHP 8, and among all, one of the biggest questions popping up is &ndash; &ldquo;is WordPress already compatible with PHP 8, and if not, then what actions are needed.&rdquo;<\/p><p><img decoding=\"async\" class=\"aligncenter size-full wp-image-15177\" src=\"\" alt=\"WordPress &amp; PHP 8 - Compatibility &amp; benefits!\" width=\"735\" height=\"350\" data-layzr=\"https:\/\/www.accuwebhosting.com\/blog\/wp-content\/uploads\/2020\/12\/x-4.jpg\"><\/p><p>Well, as soon as PHP 8 is released, our expert time dived into the deepest level of testing, and the outcome can shock anyone! Yes, we know everything now and feel pleasure to flaunt our reports and outcomes of tastings.<\/p><p>Not just we&rsquo;ll show what all has changed, but also give you a pure advice regarding whether you should update to PHP 8 or not.<\/p><h2><span data-preserver-spaces=\"true\">So many breaking changes in PHP 8: But why?<\/span><\/h2><p><span data-preserver-spaces=\"true\">PHP 8 is a huge update of PHP, and it&rsquo;s common practice to remove negatives in major versions from the recent range of minor versions. For the highly-talked PHP 8, several breaking changes have been reduced in the previous 7.* versions.<\/span><\/p><p><span data-preserver-spaces=\"true\">Hence, for projects that were attentively updated over the years, fixing their derogated API&rsquo;s, it shouldn&rsquo;t be tough to upgrade at all. Telling the truth, PHP 7.* versions have observed a far bigger set of deprecations in contrast to previous versions of PHP.<\/span><\/p><p><span data-preserver-spaces=\"true\">We&rsquo;d say PHP 5.6 to PHP 7 was a pretty simple migration, but going from 7.x to 8 could be somewhat painful, especially for the old codebases, including WordPress, besides several available plugins.<\/span><\/p><p><span data-preserver-spaces=\"true\">Certainly, for well-typed codebases or up-to-date codebases with the latest PHP versions, big problems won&rsquo;t occur. However, the reality is that WordPress isn&rsquo;t such a codebase.<\/span><\/p><h2><span data-preserver-spaces=\"true\">Is WordPress already compatible with PHP 8?<\/span><\/h2><p><span data-preserver-spaces=\"true\">Saying honestly, maybe WordPress is already compatible with PHP 8, but sealing those words isn&rsquo;t possible, though. <\/span><a class=\"editor-rtfLink ext-link wpel-icon-right\" href=\"https:\/\/make.wordpress.org\/core\/handbook\/references\/php-compatibility-and-wordpress-versions\/\" target=\"_blank\" rel=\"noopener noreferrer nofollow external\" data-wpel-link=\"external\"><span data-preserver-spaces=\"true\">WordPress targets to always be compatible with the latest versions of PHP<\/span><i class=\"wpel-icon fa fa-external-link\" aria-hidden=\"true\"><\/i><\/a><span data-preserver-spaces=\"true\">. However, we&rsquo;ve deeply analyzed the biggest concerns later in this guide.<\/span><\/p><p><img decoding=\"async\" class=\"aligncenter size-full wp-image-15301\" src=\"\" alt=\"Wordpress-and-PHP-Compatibility2\" width=\"735\" height=\"380\" data-layzr=\"https:\/\/www.accuwebhosting.com\/blog\/wp-content\/uploads\/2021\/01\/Wordpress-and-PHP-Compatibility2.jpg\"><\/p><p><span data-preserver-spaces=\"true\">We&rsquo;ve done an amazing job concerning finding the perfect fixes for the majority of the compatibility problems that could be found using the available strategies. We&rsquo;ll certainly dive deeper into what all was there and the problems that exist with them.<\/span><\/p><h2><span data-preserver-spaces=\"true\">What performance changes are coming?<\/span><\/h2><p><span data-preserver-spaces=\"true\">The major potentially exciting feature arriving with PHP 8 is JIT (Just In Time) compilation and debugging. As we know, PHP is an interpreted language, which means it&rsquo;s translated into machine code when it runs. <\/span><\/p><p><span data-preserver-spaces=\"true\">JIT tracks the code that&rsquo;s frequently used and works on optimizing the machine code translation to make it reusable. Now, this can result in a huge performance improvement for a given functionality.<\/span><\/p><p><span data-preserver-spaces=\"true\">The inclusion of JIT in various languages, for example, JavaScript, has historically conducted an explosion of new applications. For instance, virtual machines running in JS would&rsquo;ve been out of imagination in the web&rsquo;s early days. A few tasks that would have needed the installation of modules on the server in the past are going to be practical using core PHP libraries.<\/span><\/p><p><span data-preserver-spaces=\"true\">For the time being, the actual performance elevation for web apps like WordPress is minimal. Besides that, it will take a huge time before a developer or an average WordPress user reaps the advantages of this new feature.<\/span><\/p><p><span data-preserver-spaces=\"true\">There are several other new features to bring ease to the developers&rsquo; lives; it&rsquo;s unlikely that these are going to be used in WP themes and plugins for the foreseeable future because the majority would break compatibility with PHP&rsquo;s earlier versions still in use by several WordPress sites.<\/span><\/p><h2><span data-preserver-spaces=\"true\">How to update PHP for your WordPress site?<\/span><\/h2><p><span data-preserver-spaces=\"true\">In this guide, we&rsquo;ll describe how conveniently you can update PHP to the latest version, most importantly, without breaking your WordPress site.<\/span><\/p><p><span data-preserver-spaces=\"true\">If you are eager to know the path, then just check your current PHP version, then Update WordPress to the newest version. After that, Install the &ldquo;one.com PHP scanner&rdquo; and run a scan to fix potential issues. Further, update PHP to the latest version, and verify whether your site is working as expected or not.<\/span><\/p><p><span data-preserver-spaces=\"true\">Let&rsquo;s show the whole process.<\/span><\/p><h3>Step 1: Check your current PHP version<\/h3><p><span data-preserver-spaces=\"true\">In the very beginning, you have to check what PHP version you&rsquo;re currently rolling on with. You can get the information of the current PHP version of your website from the<strong><a href=\"https:\/\/manage.accuwebhosting.com\/knowledgebase\/3693\/How-to-create-and-view-phpinfo-file-in-cPanel.html\" target=\"_blank\" rel=\"noopener\" data-wpel-link=\"internal\"> phpinfo page. <\/a><\/strong><\/span><\/p><p>If you are running on the cPanel, you can view PHP version from the article <a href=\"https:\/\/manage.accuwebhosting.com\/knowledgebase\/3146\/How-To-View-And-Change-PHP-Version-From-cPanel.html\" target=\"_blank\" rel=\"noopener\" data-wpel-link=\"internal\"><strong>how to view and change PHP version in cPanel.<\/strong><\/a><\/p><p><span data-preserver-spaces=\"true\">In case you&rsquo;re using PHP version 7.3 or higher, then everything is fine. For those having PHP 7.2, an update is needed. Please cherish to step 2.<\/span><\/p><h3><span data-preserver-spaces=\"true\">Step 2: Update WordPress to the latest version<\/span><\/h3><p><span data-preserver-spaces=\"true\">Ensure that WordPress core and all the plugins and themes are updated to the latest version if you really want to avoid any malfunction.<\/span><\/p><ol>\n<li><span data-preserver-spaces=\"true\">Log in to your <\/span><strong><span data-preserver-spaces=\"true\">WordPress Admin<\/span><\/strong><span data-preserver-spaces=\"true\"> and Click <\/span><strong><span data-preserver-spaces=\"true\">Dashboard<\/span><\/strong><span data-preserver-spaces=\"true\"> &gt; <\/span><strong><span data-preserver-spaces=\"true\">Updates<\/span><\/strong><span data-preserver-spaces=\"true\">.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Check whether you&rsquo;ve got the latest version of WordPress installed and that all themes and plugins are up to date.<a href=\"https:\/\/manage.accuwebhosting.com\/knowledgebase\/2095\/How-to-update-your-WordPress-installation-through-one-click-update-method.html\" target=\"_blank\" rel=\"noopener\" data-wpel-link=\"internal\"><strong>Update your WordPress to the latest version now. <\/strong><\/a><\/span><\/li>\n<\/ol><h2 id=\"step-2\" data-i18n=\"16-vDcJ27aZMW\"><\/h2><h3><span data-preserver-spaces=\"true\">Step 3: Install the &ldquo;one.com PHP scanner.&rdquo;<\/span><\/h3><ol>\n<li><span data-preserver-spaces=\"true\">In your <\/span><strong><span data-preserver-spaces=\"true\">WordPress Admin<\/span><\/strong><span data-preserver-spaces=\"true\">, tap <\/span><strong><span data-preserver-spaces=\"true\">one.com<\/span><\/strong><span data-preserver-spaces=\"true\"> &gt; <\/span><strong><span data-preserver-spaces=\"true\">Plugins<\/span><\/strong><span data-preserver-spaces=\"true\">.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Locate the <\/span><strong><span data-preserver-spaces=\"true\">one.com PHP scanner<\/span><\/strong><span data-preserver-spaces=\"true\"> and <\/span><strong><span data-preserver-spaces=\"true\">tap Install now<\/span><\/strong><span data-preserver-spaces=\"true\">.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Now, click <\/span><strong><span data-preserver-spaces=\"true\">Activate<\/span><\/strong><span data-preserver-spaces=\"true\">, and move to the next step.<\/span><\/li>\n<\/ol><h3><span data-preserver-spaces=\"true\">Step 4: Run a scan &amp; fix potential issues<\/span><\/h3><ol>\n<li><span data-preserver-spaces=\"true\">In the menu on the left, tap <\/span><strong><span data-preserver-spaces=\"true\">PHP scanner<\/span><\/strong><span data-preserver-spaces=\"true\">.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Tap <\/span><strong><span data-preserver-spaces=\"true\">PHP version 7.4<\/span><\/strong><span data-preserver-spaces=\"true\">, then &ldquo;<\/span><strong><span data-preserver-spaces=\"true\">All themes and plugins<\/span><\/strong><span data-preserver-spaces=\"true\">,&rdquo; and then <\/span><strong><span data-preserver-spaces=\"true\">tap Start scan<\/span><\/strong><span data-preserver-spaces=\"true\">.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">You can proceed once the scan is finished.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">You can have three results:<\/span><\/li>\n<\/ol><p><span data-preserver-spaces=\"true\">&ndash; <\/span><strong><span data-preserver-spaces=\"true\">Compatible<\/span><\/strong><span data-preserver-spaces=\"true\"> = It means all is good!<\/span><\/p><p><span data-preserver-spaces=\"true\">&ndash; <\/span><strong><span data-preserver-spaces=\"true\">Warning<\/span><\/strong><span data-preserver-spaces=\"true\"> = It means that it should work but might give issues with the upcoming PHP version.<\/span><\/p><p><span data-preserver-spaces=\"true\">&ndash; <\/span><strong><span data-preserver-spaces=\"true\">Error<\/span><\/strong><span data-preserver-spaces=\"true\"> = It&rsquo;s not so good, will certainly cause issues after updating.<\/span><\/p><p><span data-preserver-spaces=\"true\">Fix any themes or plugins that read errors, either by updating it to the latest version or by replacing it with an alternative plugin providing the same functionality.<\/span><\/p><p><strong><span data-preserver-spaces=\"true\">Tip:<\/span><\/strong><span data-preserver-spaces=\"true\"> We recommend you to use just those plugins use plugins that get updated regularly and bring no compatibility issues with the latest version of WordPress. Besides that, it&rsquo;s a good practice to remove any unwanted plugins to enhance the site&rsquo;s performance.<\/span><\/p><h3><span data-preserver-spaces=\"true\">Step 5: Update PHP to the 8.0 version<\/span><\/h3><p><span data-preserver-spaces=\"true\">You are now all set to update PHP. We recommend to turn on PHP error messages simultaneously. In case there&rsquo;s an issue with the code, you&rsquo;ll see error messages telling you what&rsquo;s causing it and also where exactly it&rsquo;s located.<\/span><\/p><ol>\n<li><span data-preserver-spaces=\"true\">In the control panel, return to <\/span><strong><span data-preserver-spaces=\"true\">PHP and database settings<\/span><\/strong><span data-preserver-spaces=\"true\">.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Scroll down to <\/span><strong><span data-preserver-spaces=\"true\">PHP error messages<\/span><\/strong><span data-preserver-spaces=\"true\">.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Click <\/span><strong><span data-preserver-spaces=\"true\">Update <\/span><\/strong><span data-preserver-spaces=\"true\">after setting the error messages to <\/span><strong><span data-preserver-spaces=\"true\">On<\/span><\/strong><span data-preserver-spaces=\"true\">.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Directly below this, change the version and <\/span><strong><span data-preserver-spaces=\"true\">tap Update<\/span><\/strong><span data-preserver-spaces=\"true\">.<\/span><\/li>\n<\/ol><h2 id=\"step-5\" data-i18n=\"38-SqNHvuEKtm\"><\/h2><h3><span data-preserver-spaces=\"true\">Step 6: Verify whether your website is working as expected.<\/span><\/h3><p><span data-preserver-spaces=\"true\">Now, you&rsquo;ve got the PHP version updated, and it will <\/span><strong><span data-preserver-spaces=\"true\">take a minimum of 20 minutes<\/span><\/strong><span data-preserver-spaces=\"true\"> before the changes apply. If your site receives a lot of visitors, the time frame may extend to even several hours. That&rsquo;s the reason we recommend checking your website a couple of times minimum during the upcoming 24 hours.<\/span><\/p><p><span data-preserver-spaces=\"true\">In case your site isn&rsquo;t working against what you expected, then the most likely issue is your theme or any plugin. To find out what&rsquo;s exactly causing issues:<\/span><\/p><ol>\n<li><span data-preserver-spaces=\"true\">Temporarily switch to the default WordPress theme, we&rsquo;d say, &ldquo;Twenty Seventeen&rdquo;.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Select all installed plugins and deactivate them altogether.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Enable themes and all plugins again, one by one, and keep checking each time whether your site is still working or not. You can catch the culprit this way.<\/span><\/li>\n<\/ol><p><span data-preserver-spaces=\"true\">If we talk technically, then the compatibility of the present-time nightly of WordPress with the highly discussed PHP 8 is at a similar level as we inhabit from WordPress releases right before a fresh version of PHP pops-up.<\/span><\/p><p><span data-preserver-spaces=\"true\">Our testing was as substantial, the fixing was as meticulous, and the level of trouble-fixes was as huge as any of PHP compatibility fixing inside WordPress core. However, if you don&rsquo;t follow this guide, you won&rsquo;t be able to understand the compatibility challenges and reap maximum benefits out of PHP 8.<\/span><\/p><p><span data-preserver-spaces=\"true\">The huge amount of breaking changes and the sorts of changes included in PHP 8, besides a few added complexities in cross-version tooling, certainly make this compatibility challenge a bigger beast from what we&rsquo;ve experienced before with the previous versions of PHP. This report targets to explain the same case.<\/span><\/p><h2>WordPress and PHP8 Compatibility challenges<\/h2><p><span data-preserver-spaces=\"true\">We&rsquo;d show you a few strategies that you can deploy for making an existing codebase compatible with PHP 8.<\/span><\/p><ul>\n<li><span data-preserver-spaces=\"true\">Static analysis tools such as PHPCompatibility to detect syntactic problems.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Automated testing to detect runtime problems.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Manual testing to detect runtime problems.<\/span><\/li>\n<\/ul><p><span data-preserver-spaces=\"true\">Depending on your test suite&rsquo;s coverage and the proportion of syntactic changes and runtime, these strategies serve nicely for fixing the codebase&rsquo;s compatibility with a new version of PHP (currently discussing PHP 8).<\/span><\/p><p><span data-preserver-spaces=\"true\">Truly, in the case of PHP 8 and WordPress, there are a few additional challenges that make it difficult to rely on these strategies in accordance to ensure perfect compatibility of WordPress with PHP 8. Below we&rsquo;ll report on strategies which we&rsquo;ve deployed for WordPress and share the results.<\/span><\/p><h3><span data-preserver-spaces=\"true\">Static analysis tools<\/span><\/h3><p><span data-preserver-spaces=\"true\">Because of the nature of a few changes in PHP 8.0, the problems which can be detected using static analysis are limited. In those circumstances, where static analysis looks to go beyond their traditional potentials and plans to trace the value of variables and constants and runtime type, the results of such scans are certainly going to be prone to false positives.<\/span><\/p><p><img decoding=\"async\" class=\"aligncenter size-full wp-image-15304\" src=\"\" alt=\"Static-analysis-tools\" width=\"735\" height=\"380\" data-layzr=\"https:\/\/www.accuwebhosting.com\/blog\/wp-content\/uploads\/2021\/01\/Static-analysis-tools.jpg\"><\/p><p><span data-preserver-spaces=\"true\">Besides that, PHP Compatibility is the one and only static analysis tool meant to find PHP cross-version compatibility related issues.<\/span><\/p><p><span data-preserver-spaces=\"true\">Besides PHP Compatibility, other static analysis tools report on a larger scope of issues. Cherishing the results to detect the issues, which are PHP cross-version compatibility related <\/span><em><span data-preserver-spaces=\"true\">and <\/span><\/em><span data-preserver-spaces=\"true\">actually correct, is pretty time-consuming and needs in-depth tooling-related knowledge, especially about configuring them for the least amount of noise.<\/span><\/p><p><span data-preserver-spaces=\"true\">Simultaneously, these tools are in constant instability, trying to roll on with the changes in the PHP version and updating the possible scans. Hence, we can expect these tools to detect still more issues in the upcoming future.<\/span><\/p><p><span data-preserver-spaces=\"true\">So independently of what has already been and can be further found at this time, the chances are that these tools will still find more issues in the (near) future.<\/span><\/p><h4><span data-preserver-spaces=\"true\">Scanning WordPress with PHPCompatibility<\/span><\/h4><p><span data-preserver-spaces=\"true\">&ldquo;__destruct() won&rsquo;t be called after die() in __construct() any longer&rdquo; is another PHP 8 issue found by PHPCompatibility. This is perfectly detected by the scanner. However, upon further analysis, it has been figured out not to be problematic in this case.<\/span><\/p><p><span data-preserver-spaces=\"true\">Besides that, PHPCompatibility detected a problem in code that&rsquo;s used by &ldquo;Plugin\/Theme editor.&rdquo; Involved code&rsquo;s analyses have determined the existence of an underlying oversight in the code. In the editor, WordPress looks forward to doing minimum analysis of the code; however, it doesn&rsquo;t take PHP 5.3+ code into account.<\/span><\/p><p><span data-preserver-spaces=\"true\">While taking relevant changes in PHP8 into account, this oversight is now be made more complex to solve. We ran scans with PHPCompatibility with the developed version, and the results, as we expected, were much different from what we obtained with the previous updates of PHP. Issues detected by the scanner are maintained externally.<\/span><\/p><h4><span data-preserver-spaces=\"true\">Scanning WordPress with Exakat<\/span><\/h4><p><span data-preserver-spaces=\"true\">Talking about the latest public scan that took place on October 16th, based on WP trunk, <\/span> Exakat <span data-preserver-spaces=\"true\"> reports 149.567 issues in total.<\/span><\/p><p>The PHP 8 compatibility report shows us a total of 93 issues. However, it&rsquo;s incomplete as an analysis number relevant for PHP 8 aren&rsquo;t included in the report.<\/p><p>While we expect these reports to contain a great number of false positives because WordPress doesn&rsquo;t use type declarations, and therefore the types are extrapolated from the code that&rsquo;s found and the types shown in docblocks, these problems should still be examined individually.<\/p><p>No matter just 1% of the found problems is right that would still decline to ~450 errors, which still needs to be dealt with. Besides that, the great amount of time required to weed out the authentic issues from the false positives.<\/p><h4><span data-preserver-spaces=\"true\">Scanning WordPress with PHPStan<\/span><\/h4><p><span data-preserver-spaces=\"true\">Scans with <\/span>PHPStan<span data-preserver-spaces=\"true\"> require a fully customized ruleset to attain remotely usable results, and still, they prove to be riddled with a few false positives, making the output unusable.<\/span><\/p><p><strong><em><span data-preserver-spaces=\"true\">Note: We aren&rsquo;t criticizing the PHPStan tooling, but it is hugely due to the fact that WordPress hardly uses type declarations, while on the other hand, PHPStan is primarily inclined towards projects using modern code, isn&rsquo;t it?<\/span><\/em><\/strong><\/p><p><span data-preserver-spaces=\"true\">An initial scan comprising the most basic of configurations will yield 20.000+ issues. A scan with the highly customized above-mentioned ruleset, targetted at PHP 8 related problems specifically, still yields exactly 580 issues at level 5 and additional 2.150 potential issues at level 7. These will likely contain a few false positives and yet yield 380 issues more at level 8 with a similar caveat.<\/span><\/p><p><span data-preserver-spaces=\"true\">A <\/span><a class=\"editor-rtfLink ext-link wpel-icon-right\" href=\"https:\/\/core.trac.wordpress.org\/ticket\/51423\" target=\"_blank\" rel=\"noopener noreferrer nofollow external\" data-wpel-link=\"external\"><span data-preserver-spaces=\"true\">Trac ticket<\/span><i class=\"wpel-icon fa fa-external-link\" aria-hidden=\"true\"><\/i><\/a><span data-preserver-spaces=\"true\"> was recently opened to address a list of issues on the basis of an unknown configuration, but fully targeted yo passed parameter type mismatches (level 5). <\/span><a class=\"editor-rtfLink ext-link wpel-icon-right\" href=\"https:\/\/github.com\/WordPress\/wordpress-develop\/pull\/553\" target=\"_blank\" rel=\"noopener noreferrer nofollow external\" data-wpel-link=\"external\"><span data-preserver-spaces=\"true\">Draft PR<\/span><i class=\"wpel-icon fa fa-external-link\" aria-hidden=\"true\"><\/i><\/a><span data-preserver-spaces=\"true\"> is available to fix these issues.<\/span><\/p><p><span data-preserver-spaces=\"true\">An inceptive assessment of this PR indicates that most of the fixes proposed would typecast variables to the expected type and <\/span><em><span data-preserver-spaces=\"true\">hide<\/span><\/em><span data-preserver-spaces=\"true\"> issues, not actually fix them by checking properly. This leads to unexpected behavior in the application in case these changes aren&rsquo;t accompanied by strict unit tests. Besides that, tit likely results in increasing difficulty while debugging errors further down the line for sure.<\/span><\/p><p><span data-preserver-spaces=\"true\">Currently, it isn&rsquo;t confirmed whether the fixes proposed are warranted or that the identified issues should be observed as false positives.<\/span><\/p><h3><span data-preserver-spaces=\"true\">Testing<\/span><\/h3><p><span data-preserver-spaces=\"true\">Static analysis can just go so far because of the nature of the problematic swaps in PHP8. Manually reviewing and testing software proves to be such painstaking work, and humans are also pretty prone to overlook things when there&rsquo;s much to be looking out for.<\/span><\/p><p><span data-preserver-spaces=\"true\">Now, talking about testing performed by <\/span><em><span data-preserver-spaces=\"true\">end-users, they prove to be relatively useless, <\/span><\/em><span data-preserver-spaces=\"true\">as this will normally result in &ldquo;happy paths&rdquo; being tested. If we want to achieve more reliable results, then we need comprehensive exploratory and regression testing.<\/span><\/p><p><img decoding=\"async\" class=\"aligncenter size-full wp-image-15303\" src=\"\" alt=\"Testing\" width=\"735\" height=\"380\" data-layzr=\"https:\/\/www.accuwebhosting.com\/blog\/wp-content\/uploads\/2021\/01\/Testing.jpg\"><\/p><p><span data-preserver-spaces=\"true\">Having automated tests of high quality and running these on PHP 8 is more important than anything. This will offer the perfect indication of the PHP 8.0 issue to expect.<\/span><\/p><p>Most of the tech-geeks are excited with the PHP 8.0, and certainly, the changes are huge this time. everyone is going to consume some time to understand the compatibility, configurations, benefits etc. of PHP 8, and among all, one of the biggest question popping up is &ndash; &ldquo;is WordPress already compatible with PHP 8, and if not, then what actions are needed.&rdquo;<\/p><p>Well, as soon as PHP 8 released, our expert time dived into deepest level of testing, and the outcome can shock anyone! yes, we know everything now, and feel pleasure to flaunt our reports and outcomes of testings.<\/p><p>Let&rsquo;s move on to <span data-preserver-spaces=\"true\">Running automated tests on PHP 8 now.<\/span><\/p><h2><span data-preserver-spaces=\"true\">Running automated tests on PHP 8<\/span><\/h2><p><span data-preserver-spaces=\"true\">PHPUnit 9.3 is the first PHPUnit version that&rsquo;s officially compatible with PHP 8.0, and it was released in August 2020. Well, running an automated test suite running on PHP is tough because the de facto tool for unit testing.<\/span><\/p><p><img decoding=\"async\" class=\"aligncenter size-full wp-image-15305\" src=\"\" alt=\"running-automated\" width=\"735\" height=\"380\" data-layzr=\"https:\/\/www.accuwebhosting.com\/blog\/wp-content\/uploads\/2021\/01\/running-automated.jpg\"><\/p><p><span data-preserver-spaces=\"true\">Getting an automated test suite to run on PHP 8 takes us down the next rabbit hole as the de facto tool for performing the unit test in the PHP world; PHPUnit normally does a huge release every year, with every single major drop support for previous PHP versions. It introduces breaking changes, but as PHPUnit 9.3 is officially compatible with PHP 8.0, as we mentioned above, there is no need to worry!<\/span><\/p><p><span data-preserver-spaces=\"true\">We know that, as a minimum, WordPress still supports PHP 5.6. For running tests on PHP 8.0, any test suite related to WordPress needs to be fully compatible with PHPUnit 5 up to PHPUnit 9. Certainly, tooling is built to help you with that; it still consumes effort and time to implement these tools to make a test suite compatible.<\/span><\/p><h3><span data-preserver-spaces=\"true\">Getting the tests running on PHP8 for WordPress Core<\/span><\/h3><p><span data-preserver-spaces=\"true\">The tests for WP Core are currently passing and running against PHP 8. These tests are being conducted on PHPUnit 7.5&rsquo;s composer installed version. Even though PHPUnit 9.3 is the oldest PHPUnit version that&rsquo;s officially compatible with PHP 8.<\/span><\/p><p><span data-preserver-spaces=\"true\">This last issue has been tackled by copying a selected number of files\/classes from PHPUnit 9.3 to the WordPress test suite, excluding the native classes of PHPUnit from the Composer autoload generation, supporting the usage of copies from PHPUnit 9.3 in the WordPress test suite. This works, for now, however, we&rsquo;d call it a hacky solution, and it may not be sustainable in the upcoming, besides the maintenance it may currently need.<\/span><\/p><p><span data-preserver-spaces=\"true\">For the sake of tests&rsquo; quality, this was certainly low to start with, with loose type checking being utilized in most of the cases.<\/span><\/p><p><span data-preserver-spaces=\"true\">Getting deeper, a Trac ticket to address this was opened back in 2016. Considering the stricter type adherence in PHP, this ticket has been restored. Much work has been undertaken to mitigate this.<\/span><\/p><p><span data-preserver-spaces=\"true\">While we wrote, there are around 800 instances (676 assertEquals() added to 96 assertNotEquals()). Still utilizing loose type checking &ndash; down from 8000+ instances.<\/span><\/p><p><span data-preserver-spaces=\"true\">In part, the loose type assertions that were remaining are legitimate when objects are compared; in part, these certainly need to be addressed. However, it would currently lead to test failures. These last ones underline shortcomings either in the tests, however more occasionally, in the code being tested.<\/span><\/p><h3><span data-preserver-spaces=\"true\">Testing themes and plugins<\/span><\/h3><p><span data-preserver-spaces=\"true\">There is only a small percentage of the available plugins, the professionally developed ones and more popular and, have automated tests in place. Generally speaking, this is worrisome as a normal WordPress site runs nearly 19 or 20 plugins for sure. Quite a few sites roll on with even more plugins! Having automated testing in place for themes is even rarer.<\/span><\/p><p><span data-preserver-spaces=\"true\">It is challenging to allow these test suites to run on PHP version 8. And also before insight can be gained regarding the compatibility of plugins and themes with PHP 8.<\/span><\/p><p><span data-preserver-spaces=\"true\">However, the plugins\/themes which <\/span><em><span data-preserver-spaces=\"true\">having <\/span><\/em><span data-preserver-spaces=\"true\">are mostly the ones where the minimum amount of PHP 8.0 issues can be expected. We exclaim so because such themes\/plugins use a professional development model.<\/span><\/p><p><span data-preserver-spaces=\"true\">The bigger cause of concern is the multitude of tests and themes <\/span><em><span data-preserver-spaces=\"true\">without<\/span><\/em><span data-preserver-spaces=\"true\"> tests, as these are more prone to be problematic while running with PHP 8.<\/span><\/p><h2><span data-preserver-spaces=\"true\">For themes and plugins, which <\/span><em><span data-preserver-spaces=\"true\">do<\/span><\/em><span data-preserver-spaces=\"true\"> have tests, primarily two types of tests are there which they may or may not have right in place:<\/span><\/h2><ul>\n<li><strong><span data-preserver-spaces=\"true\">Unit tests<\/span><\/strong><span data-preserver-spaces=\"true\">. Stand-alone tests which &ldquo;deride&rdquo; WP to permit the testing of the plugin code. Popular frameworks like<\/span><a class=\"editor-rtfLink ext-link wpel-icon-right\" href=\"https:\/\/github.com\/Brain-WP\/BrainMonkey\" target=\"_blank\" rel=\"noopener noreferrer nofollow external\" data-wpel-link=\"external\"><span data-preserver-spaces=\"true\">BrainMonkey <\/span><i class=\"wpel-icon fa fa-external-link\" aria-hidden=\"true\"><\/i><\/a><span data-preserver-spaces=\"true\">and <\/span><a class=\"editor-rtfLink ext-link wpel-icon-right\" href=\"https:\/\/github.com\/mockery\/mockery\" target=\"_blank\" rel=\"noopener noreferrer nofollow external\" data-wpel-link=\"external\"><span data-preserver-spaces=\"true\">Mockery <\/span><i class=\"wpel-icon fa fa-external-link\" aria-hidden=\"true\"><\/i><\/a><span data-preserver-spaces=\"true\">are used.<\/span><\/li>\n<li><strong><span data-preserver-spaces=\"true\">Integration tests<\/span><\/strong><span data-preserver-spaces=\"true\">. Now, <\/span><strong><span data-preserver-spaces=\"true\">Integration tests<\/span><\/strong><span data-preserver-spaces=\"true\"> are where WordPress itself loads before we run the test suite, and it will use the WPcore code and integrate with the WP test suite.<\/span><\/li>\n<\/ul><h3><span data-preserver-spaces=\"true\">Integration tests<\/span><\/h3><p><span data-preserver-spaces=\"true\">We know WordPress has decided to stick to PHPUnit 7.5. What does that mean?<\/span><\/p><p><span data-preserver-spaces=\"true\">Well, for integration tests for themes and plugins, those will also be jumped to PHPUnit 7.5 (maximum).<\/span><\/p><p><span data-preserver-spaces=\"true\">Themes and plugins will either have to copy the hack in WP core to get their integration tests perfectly running, or alternatively, they will have to <\/span><em><span data-preserver-spaces=\"true\">use<\/span><\/em><span data-preserver-spaces=\"true\"> the files in WP Core. However, they will then have to create a custom autoloader because the same Composer autoload generation hack can&rsquo;t be used.<\/span><\/p><p><span data-preserver-spaces=\"true\">If PHPUnit native files need to be prevented from loading anyway, such a custom autoloader will have to be surely bootstrapped <\/span><em><span data-preserver-spaces=\"true\">right before<\/span><\/em><span data-preserver-spaces=\"true\"> the Composer autoload file.<\/span><\/p><h3><span data-preserver-spaces=\"true\">Unit tests<\/span><\/h3><p><span data-preserver-spaces=\"true\">For unit tests with the help of Mockery or BrainMonkey, PHPUnit &gt; 8 is required as the Mockery framework available for PHPUnit 7.x isn&rsquo;t compatible with PHP 8.0. Hence, the comparability of these test suites is compulsory with PHPUnit 5 up to 9, which certainly adds another challenge.<\/span><\/p><p><span data-preserver-spaces=\"true\">How?<\/span><\/p><p><span data-preserver-spaces=\"true\">Different versions of PHPUnit are required to run each test suite when both sorts of test suites are being used. To aggravate this circumstance, plugins will normally have a committed composer.lock file to ensure that their runtime dependencies are at a given version they can rely on and which is fully compatible with PHP 5.6.<\/span><\/p><p><img decoding=\"async\" class=\"aligncenter size-full wp-image-15302\" src=\"\" alt=\"Unit-tests\" width=\"735\" height=\"380\" data-layzr=\"https:\/\/www.accuwebhosting.com\/blog\/wp-content\/uploads\/2021\/01\/Unit-tests.jpg\"><\/p><p><span data-preserver-spaces=\"true\">At certain times, this last part is enforced by having a platform php 5.6 sorts of configuration in the composer.json file. That also means their dev-dependencies BrainMonkey, Mockery, PHPUnit, will <\/span><em><span data-preserver-spaces=\"true\">also<\/span><\/em><span data-preserver-spaces=\"true\"> get locked at a version that&rsquo;s compatible with PHP 5.6. now, that would surely prevent running tests on PHP 8.0.<\/span><\/p><p><span data-preserver-spaces=\"true\">You can overcome that by on-the-fly removing the platform besides updating the composer.lock files and composer.json. However, this makes running the tests on PHP 8.0 more involved, both in CI and locally, for its developers.<\/span><\/p><h2><span data-preserver-spaces=\"true\">PHP 8 compatibility is looking somewhat tricky on large WordPress sites<\/span><\/h2><p><span data-preserver-spaces=\"true\">By just investigating a chain of breaking changes in PHP 8, we could confirm this is prone to cause huge breakage on sites with the unclear reason for that breakage. At certain times, the error will happen in one place but is generated by a theme or plugin in a different place, amd that would certainly make these issues pretty hard to debug.<\/span><\/p><p><a class=\"editor-rtfLink\" href=\"https:\/\/www.accuwebhosting.com\/\" target=\"_blank\" rel=\"noopener noreferrer\" data-wpel-link=\"internal\"><em><span data-preserver-spaces=\"true\">accuwebhosting.com<\/span><\/em><\/a><em><span data-preserver-spaces=\"true\"> is certainly an actively maintained WordPress site, and a dedicated team of professional developers supports it. The vast majority of WordPress sites don&rsquo;t have such luxury, and mitigating compatibility issues on these sites will be challenging for sure. <\/span><\/em><\/p><h2><span data-preserver-spaces=\"true\">How long do developers have to update?<\/span><\/h2><p><span data-preserver-spaces=\"true\">The life cycle of Each version of PHP is of 2 years, and bugs are fixed in this era. One more year is added during which security problems are patched. PHP 7.4 arrived in November 2019. It was the final version of PHP 7. It means that bugs in PHP 7.4 are going to be fixed until November 2021. Security problems will be patched until November 2022. It will reach its &ldquo;End of Life&rdquo; at that point in time.<\/span><\/p><p><img decoding=\"async\" class=\"aligncenter size-full wp-image-15306\" src=\"\" alt=\"developers-have-to-update\" width=\"735\" height=\"380\" data-layzr=\"https:\/\/www.accuwebhosting.com\/blog\/wp-content\/uploads\/2021\/01\/developers-have-to-update.jpg\"><\/p><p><span data-preserver-spaces=\"true\">Hence, the hard cutoff date is November 2022: all PHP code needs to be compatible with PHP 8 by this time, or dangers of being stuck on a potentially vulnerable PHP version.<\/span><\/p><h2>Conclusion<\/h2><p><span data-preserver-spaces=\"true\">PHP 8 will contain numerous breaking changes. We&rsquo;ve described a good range of those changes in our report, the ones which our experts assume will have the fiercer impact on WordPress besides the broader WordPress ecosystem. Those generally have to deal with warnings becoming problems. And several errors are introduced, which can be tough to deal with. You can detect a higher percentage of these changes on runtime.<\/span><\/p><p><span data-preserver-spaces=\"true\">Fixing all of these compatibility issues is a huge task. To accomplish that, you need to use a variety of strategies, starting from static analysis to automated testing. It requires huge time+ effort.<\/span><\/p><p><span data-preserver-spaces=\"true\">You should have the right to tool to conduct everything perfectly. For projects such as WordPress, which have to support a variety of PHP versions, several extra complexities are introduced in juggling various versions of the analysis tools, as we discussed above.<\/span><\/p><p><span data-preserver-spaces=\"true\">Certainly, it becomes pretty hard due to the runtime and syntactic differences between PHP 5 and 8 being so incredibly huge.<\/span><\/p><p><span data-preserver-spaces=\"true\">Is using PHP 8 on WordPress good or not? Actually isn&rsquo;t the argument here. The only conclusion here is &ndash; it becomes very challenging to do so.<\/span><\/p><p><span data-preserver-spaces=\"true\">Also, we&rsquo;ve considered the issue of coverage and WordPress&rsquo;s PHP dependencies. If you want to reliably detect compatibility, then high test coverage proves to be necessary. And talking about PHP 8, it&rsquo;s even more important because the number of compatibility issues is higher than usual. A major percentage of them can be detected just on runtime.<\/span><\/p><h3><span data-preserver-spaces=\"true\">So, what do we advise?<\/span><\/h3><p><span data-preserver-spaces=\"true\">If issues are detected, extensive debugging is required to find the root of the problem, no matter it&rsquo;s WordPress, Theme, Plugin, or it&rsquo;s associated directly with PHP compatibility.<\/span><\/p><p><span data-preserver-spaces=\"true\">Test coverage is virtually absent for dependencies and low. Hence, it&rsquo;s hard to exclaim what is WordPress core compatibility with PHP 8 in a true sense.<\/span><\/p><p><span data-preserver-spaces=\"true\">Because of PHP 8 concentrating so deeply on strict typing, WP&rsquo;s type unsafe extensibility system becomes extra vulnerable to issues, potentially leading to plugins generating type errors in other plugins or WP itself.<\/span><\/p><p><span data-preserver-spaces=\"true\">We put this to testing by running an analysis on error data the last month. As a huge site, we figured it might give a strong indication of the sorts of problems we can expect. Certainly, we found several warnings that will evolve into errors with PHP 8.<\/span><\/p><p><span data-preserver-spaces=\"true\">We&rsquo;d prefer making a final note here. WordPress isn&rsquo;t the only legacy codebase available. Also it&rsquo;s not the sole project which targets to support a huge range of PHP versions. The info in this article might apply well to other projects too.<\/span><\/p><p><span data-preserver-spaces=\"true\">The primary goal of this article from <\/span><a class=\"editor-rtfLink\" href=\"https:\/\/www.accuwebhosting.com\/\" target=\"_blank\" rel=\"noopener noreferrer\" data-wpel-link=\"internal\"><span data-preserver-spaces=\"true\">Accuweb<\/span><\/a><span data-preserver-spaces=\"true\"> is to inform and make an overview of the challenges and issues related to PHP 8 compatibility in WP. We highly hope it serves this purpose perfectly.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most of the tech-geeks are excited with PHP 8.0, and certainly, the changes are huge this time. everyone is going to consume some time to understand the compatibility, configurations, benefits, etc., of PHP 8, and among all, one of the biggest questions popping up is &ndash; &ldquo;is WordPress already compatible with PHP 8, and if not, then what actions are needed.&rdquo;Well, as soon as PHP 8 is released, our expert time dived into the deepest level of testing, and the outcome can shock anyone! Yes, we know everything now and feel pleasure to flaunt our reports and outcomes of tastings.Not <\/p>\n","protected":false},"author":4,"featured_media":15178,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,843],"tags":[827,830,832,834,836,835,833,826,828,831,829],"class_list":["post-15049","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tips-tricks","category-wordpress","tag-php-8-compatibility","tag-php-8-compatiblity-with-wordpress","tag-php8","tag-php8-need-to-know","tag-what-is-in-php-8","tag-what-is-in-php8","tag-what-is-new-in-php8","tag-wordpress-php-8-compatibility-benefits","tag-wordpress-and-php-8-compatibility","tag-wordpress-and-php-compatibility-with-new-vesrsion-php-8","tag-wordpress-compatibility-with-php-8","has_thumb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.1 (Yoast SEO v28.1) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>WordPress &amp; PHP 8: Compatibility and Key Benefits Explained<\/title>\n<meta name=\"description\" content=\"If you&#039;re unaware of whether PHP 8 is coimpatible to Wordpress or not, you certainly need to read our fully-explained reports (WITH benefits)\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.accuwebhosting.com\/blog\/wordpress-php-8-compatibility-benefits\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"WordPress &amp; PHP 8: Compatibility and Key Benefits Explained\" \/>\n<meta name=\"twitter:description\" content=\"If you&#039;re unaware of whether PHP 8 is coimpatible to Wordpress or not, you certainly need to read our fully-explained reports (WITH benefits)\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.accuwebhosting.com\/blog\/wp-content\/uploads\/2020\/12\/x-5.jpg\" \/>\n<meta name=\"twitter:creator\" content=\"@accuwebhosting\" \/>\n<meta name=\"twitter:site\" content=\"@accuwebhosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jason-Pat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"20 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/wordpress-php-8-compatibility-benefits\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/wordpress-php-8-compatibility-benefits\\\/\"},\"author\":{\"name\":\"Jason-Pat\",\"@id\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/fc39cf01f27372f01417fb50cc23605c\"},\"headline\":\"WordPress &#038; PHP 8 &#8211; Compatibility &#038; benefits!\",\"datePublished\":\"2021-01-04T11:53:48+00:00\",\"dateModified\":\"2025-09-15T13:58:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/wordpress-php-8-compatibility-benefits\\\/\"},\"wordCount\":4116,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/wordpress-php-8-compatibility-benefits\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/x-5.jpg\",\"keywords\":[\"PHP 8 compatibility\",\"php 8 compatiblity with wordpress\",\"PHP8\",\"PHP8 need to know\",\"what is in PHP 8\",\"what is in PHP8\",\"what is new in PHP8\",\"WordPress &amp; PHP 8 - Compatibility &amp; benefits\",\"wordpress and php 8 compatibility\",\"wordpress and php compatibility with new vesrsion PHP 8\",\"Wordpress compatibility with php 8\"],\"articleSection\":[\"Tips and Tricks\",\"WordPress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/wordpress-php-8-compatibility-benefits\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/wordpress-php-8-compatibility-benefits\\\/\",\"url\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/wordpress-php-8-compatibility-benefits\\\/\",\"name\":\"WordPress & PHP 8: Compatibility and Key Benefits Explained\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/wordpress-php-8-compatibility-benefits\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/wordpress-php-8-compatibility-benefits\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/x-5.jpg\",\"datePublished\":\"2021-01-04T11:53:48+00:00\",\"dateModified\":\"2025-09-15T13:58:00+00:00\",\"description\":\"If you're unaware of whether PHP 8 is coimpatible to Wordpress or not, you certainly need to read our fully-explained reports (WITH benefits)\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/wordpress-php-8-compatibility-benefits\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/wordpress-php-8-compatibility-benefits\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/wordpress-php-8-compatibility-benefits\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/x-5.jpg\",\"contentUrl\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/x-5.jpg\",\"width\":735,\"height\":350,\"caption\":\"WordPress & PHP 8 - Compatibility & benefits!\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/wordpress-php-8-compatibility-benefits\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WordPress &#038; PHP 8 &#8211; Compatibility &#038; benefits!\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/\",\"name\":\"VPS Hosting Blog | Windows VPS &amp; Cloud Hosting | Dedicated Servers\",\"description\":\"AccuWeb Hosting\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/#organization\",\"name\":\"AccuWeb Hosting\",\"url\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/accu-logo-01-1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/accu-logo-01-1.jpg\",\"width\":500,\"height\":600,\"caption\":\"AccuWeb Hosting\"},\"image\":{\"@id\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/accuwebhosting\\\/\",\"https:\\\/\\\/x.com\\\/accuwebhosting\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/accuwebhosting\\\/posts\\\/?feedView=all\",\"https:\\\/\\\/www.pinterest.com\\\/accuwebhosting\\\/\",\"https:\\\/\\\/www.youtube.com\\\/accuwebhosting\"],\"description\":\"AccuWeb Hosting offers Web Hosting, VPS Hosting, Cloud Computing and bare metal Dedicated Servers.\",\"email\":\"jason@accuwebhosting.com\",\"telephone\":\"8777674678\",\"legalName\":\"Vaghasia Group, Inc. DBA: AccuWebHosting.com\",\"foundingDate\":\"2003-01-13\",\"duns\":\"140072005\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"51\",\"maxValue\":\"200\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/fc39cf01f27372f01417fb50cc23605c\",\"name\":\"Jason-Pat\",\"description\":\"Founder &amp; CTO at AccuWebHosting.com. He shares his web hosting insights at AccuWebHosting blog. He mostly writes on the latest web hosting trends, WordPress, storage technologies, Windows and Linux hosting platforms.\",\"sameAs\":[\"https:\\\/\\\/www.accuwebhosting.com\",\"https:\\\/\\\/www.facebook.com\\\/accuwebhosting\",\"https:\\\/\\\/www.instagram.com\\\/accuwebhosting\\\/?hl=en\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/accuwebhosting\",\"https:\\\/\\\/x.com\\\/accuwebhosting\",\"https:\\\/\\\/www.youtube.com\\\/c\\\/Accuwebhosting\"],\"url\":\"https:\\\/\\\/www.accuwebhosting.com\\\/blog\\\/author\\\/jilesh-patadiya\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"WordPress & PHP 8: Compatibility and Key Benefits Explained","description":"If you're unaware of whether PHP 8 is coimpatible to Wordpress or not, you certainly need to read our fully-explained reports (WITH benefits)","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.accuwebhosting.com\/blog\/wordpress-php-8-compatibility-benefits\/","twitter_card":"summary_large_image","twitter_title":"WordPress & PHP 8: Compatibility and Key Benefits Explained","twitter_description":"If you're unaware of whether PHP 8 is coimpatible to Wordpress or not, you certainly need to read our fully-explained reports (WITH benefits)","twitter_image":"https:\/\/www.accuwebhosting.com\/blog\/wp-content\/uploads\/2020\/12\/x-5.jpg","twitter_creator":"@accuwebhosting","twitter_site":"@accuwebhosting","twitter_misc":{"Written by":"Jason-Pat","Est. reading time":"20 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.accuwebhosting.com\/blog\/wordpress-php-8-compatibility-benefits\/#article","isPartOf":{"@id":"https:\/\/www.accuwebhosting.com\/blog\/wordpress-php-8-compatibility-benefits\/"},"author":{"name":"Jason-Pat","@id":"https:\/\/www.accuwebhosting.com\/blog\/#\/schema\/person\/fc39cf01f27372f01417fb50cc23605c"},"headline":"WordPress &#038; PHP 8 &#8211; Compatibility &#038; benefits!","datePublished":"2021-01-04T11:53:48+00:00","dateModified":"2025-09-15T13:58:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.accuwebhosting.com\/blog\/wordpress-php-8-compatibility-benefits\/"},"wordCount":4116,"commentCount":0,"publisher":{"@id":"https:\/\/www.accuwebhosting.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.accuwebhosting.com\/blog\/wordpress-php-8-compatibility-benefits\/#primaryimage"},"thumbnailUrl":"https:\/\/www.accuwebhosting.com\/blog\/wp-content\/uploads\/2020\/12\/x-5.jpg","keywords":["PHP 8 compatibility","php 8 compatiblity with wordpress","PHP8","PHP8 need to know","what is in PHP 8","what is in PHP8","what is new in PHP8","WordPress &amp; PHP 8 - Compatibility &amp; benefits","wordpress and php 8 compatibility","wordpress and php compatibility with new vesrsion PHP 8","Wordpress compatibility with php 8"],"articleSection":["Tips and Tricks","WordPress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.accuwebhosting.com\/blog\/wordpress-php-8-compatibility-benefits\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.accuwebhosting.com\/blog\/wordpress-php-8-compatibility-benefits\/","url":"https:\/\/www.accuwebhosting.com\/blog\/wordpress-php-8-compatibility-benefits\/","name":"WordPress & PHP 8: Compatibility and Key Benefits Explained","isPartOf":{"@id":"https:\/\/www.accuwebhosting.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.accuwebhosting.com\/blog\/wordpress-php-8-compatibility-benefits\/#primaryimage"},"image":{"@id":"https:\/\/www.accuwebhosting.com\/blog\/wordpress-php-8-compatibility-benefits\/#primaryimage"},"thumbnailUrl":"https:\/\/www.accuwebhosting.com\/blog\/wp-content\/uploads\/2020\/12\/x-5.jpg","datePublished":"2021-01-04T11:53:48+00:00","dateModified":"2025-09-15T13:58:00+00:00","description":"If you're unaware of whether PHP 8 is coimpatible to Wordpress or not, you certainly need to read our fully-explained reports (WITH benefits)","breadcrumb":{"@id":"https:\/\/www.accuwebhosting.com\/blog\/wordpress-php-8-compatibility-benefits\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.accuwebhosting.com\/blog\/wordpress-php-8-compatibility-benefits\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.accuwebhosting.com\/blog\/wordpress-php-8-compatibility-benefits\/#primaryimage","url":"https:\/\/www.accuwebhosting.com\/blog\/wp-content\/uploads\/2020\/12\/x-5.jpg","contentUrl":"https:\/\/www.accuwebhosting.com\/blog\/wp-content\/uploads\/2020\/12\/x-5.jpg","width":735,"height":350,"caption":"WordPress & PHP 8 - Compatibility & benefits!"},{"@type":"BreadcrumbList","@id":"https:\/\/www.accuwebhosting.com\/blog\/wordpress-php-8-compatibility-benefits\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.accuwebhosting.com\/blog\/"},{"@type":"ListItem","position":2,"name":"WordPress &#038; PHP 8 &#8211; Compatibility &#038; benefits!"}]},{"@type":"WebSite","@id":"https:\/\/www.accuwebhosting.com\/blog\/#website","url":"https:\/\/www.accuwebhosting.com\/blog\/","name":"VPS Hosting Blog | Windows VPS &amp; Cloud Hosting | Dedicated Servers","description":"AccuWeb Hosting","publisher":{"@id":"https:\/\/www.accuwebhosting.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.accuwebhosting.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.accuwebhosting.com\/blog\/#organization","name":"AccuWeb Hosting","url":"https:\/\/www.accuwebhosting.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.accuwebhosting.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.accuwebhosting.com\/blog\/wp-content\/uploads\/2024\/07\/accu-logo-01-1.jpg","contentUrl":"https:\/\/www.accuwebhosting.com\/blog\/wp-content\/uploads\/2024\/07\/accu-logo-01-1.jpg","width":500,"height":600,"caption":"AccuWeb Hosting"},"image":{"@id":"https:\/\/www.accuwebhosting.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/accuwebhosting\/","https:\/\/x.com\/accuwebhosting","https:\/\/www.linkedin.com\/company\/accuwebhosting\/posts\/?feedView=all","https:\/\/www.pinterest.com\/accuwebhosting\/","https:\/\/www.youtube.com\/accuwebhosting"],"description":"AccuWeb Hosting offers Web Hosting, VPS Hosting, Cloud Computing and bare metal Dedicated Servers.","email":"jason@accuwebhosting.com","telephone":"8777674678","legalName":"Vaghasia Group, Inc. DBA: AccuWebHosting.com","foundingDate":"2003-01-13","duns":"140072005","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"51","maxValue":"200"}},{"@type":"Person","@id":"https:\/\/www.accuwebhosting.com\/blog\/#\/schema\/person\/fc39cf01f27372f01417fb50cc23605c","name":"Jason-Pat","description":"Founder &amp; CTO at AccuWebHosting.com. He shares his web hosting insights at AccuWebHosting blog. He mostly writes on the latest web hosting trends, WordPress, storage technologies, Windows and Linux hosting platforms.","sameAs":["https:\/\/www.accuwebhosting.com","https:\/\/www.facebook.com\/accuwebhosting","https:\/\/www.instagram.com\/accuwebhosting\/?hl=en","https:\/\/www.linkedin.com\/company\/accuwebhosting","https:\/\/x.com\/accuwebhosting","https:\/\/www.youtube.com\/c\/Accuwebhosting"],"url":"https:\/\/www.accuwebhosting.com\/blog\/author\/jilesh-patadiya\/"}]}},"_links":{"self":[{"href":"https:\/\/www.accuwebhosting.com\/blog\/wp-json\/wp\/v2\/posts\/15049","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.accuwebhosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.accuwebhosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.accuwebhosting.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.accuwebhosting.com\/blog\/wp-json\/wp\/v2\/comments?post=15049"}],"version-history":[{"count":0,"href":"https:\/\/www.accuwebhosting.com\/blog\/wp-json\/wp\/v2\/posts\/15049\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.accuwebhosting.com\/blog\/wp-json\/wp\/v2\/media\/15178"}],"wp:attachment":[{"href":"https:\/\/www.accuwebhosting.com\/blog\/wp-json\/wp\/v2\/media?parent=15049"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.accuwebhosting.com\/blog\/wp-json\/wp\/v2\/categories?post=15049"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.accuwebhosting.com\/blog\/wp-json\/wp\/v2\/tags?post=15049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}