PHP 8 Compatibility Check and Performance Tips

Originally published at: PHP 8 Compatibility Check and Performance Tips

PHP 7 was first released back on 03 Dec 2015. It’s been around a while! The PHP team encouraged upgrading to PHP 7, hailing its improvements such as being twice as fast, consistent 64-bit support, removing old and unsupported SAPIs and extensions, and improved fatal error resistance, to name a few. A few years ago,…

2 Likes

I have heard of sites tanking because of this. I think having a focus on PHP is not something you can afford to skip these days, especially if you rely on traffic for revenue, manage an online service or shop, or generally want your site to be stable, secure, and fast.

Excellent guide! You made it a lot easier to go through than I have read on other sites.

I’ve been using PHP 8 since shortly after it was released. Now I am using PHP 8.2 and it is working just fine with WordPress, although I did have to disable one plugin. It was only a minor inconvenience for some nice speed gains.

1 Like

Nice. I have been working through compatibility issues between 7.4 and 8.*. But it’s primarily sites running Magento/Openmage, Joomla, Drupal, and others. But WordPress has been pretty smooth right up to 8.1. As you also experienced, only some old plugins in some cases.

2 Likes

Agreed.

WordPress has always been very quick when adding support for the latest versions of PHP. I am usually able to upgrade within a month after release. I always spin up a staging site to test larger changes.

What are the main differences between PHP 7 and PHP 8? I have not looked into anything yet but I am going to have to upgrade/update. I am using 7.4 now and have been putting it off because of compatibility issues.

Right now, the main notable difference is that PHP 7* support ended 1 month ago (28 Nov 2022).

There’s a nice blog post here on some of the changes:

Thanks for the useful hints on how to use phan!

However, I had problems running “phan --project-root-directory --progress-bar -o phan.out” until I changed the syntax to “phan -l [the full directory to the website] -o phan.out” (e.g., “phan -l C:\inetpub\wwwroot\moodle -o phan.out”)

1 Like

Thanks. I will update the article with this. Welcome to the forums.

wow actually it is excellent guide