PHP 7 to 8 migration helper?

Hi,

on my private homepage I have Joomla installed with an external plugin. The developer of this plugin no longer exists and so it is not working under PHP 8.
I don’t want to spend too much time on this but I would like to check if I can fix the plugin to work with PHP8.

So I searched the net if there are any helper tools which automatically scan the whole code (all files with subfolders) for constructs which are no longer supported in PHP8.
The only thing I could find is called “Rector” and it looks like it does what I need, but I need to install it with composer, which is a little bit too overloaded for me.

So my question:

does anybody knows a simple script I can run, which checks the PHP for possible update conflicts so I can fix them?

There is a recent similar discussion here. Rector is pretty much the only actual conversion tool out there however you can use some of the IDE’s static analysis tools to flag possible issues.

Not meaning to be insulting but if composer is a blocking point for you then none of this stuff will work for you. Have you tried searching to see if someone else has updated the plugin? That is probably your best bet. And if no one else has taken the time to upgrade the plugin then maybe you might want to consider changing plugins.

There are very few breaking changes introduces in 8.x so I’m guessing a reasonably competent PHP developer could probably follow the error messages and tweak things as required. Might consider hiring a developer to do just that.

1 Like

There are a few different tools and scripts that you can use to check for possible update conflicts when updating your PHP version, such as:

  1. The PHP Compatibility Checker: This tool scans your codebase for potential issues and provides a report of the problems found and how to fix them. It can be run on the command line or integrated into your development workflow.
  2. Rector: This tool can automatically fix your code to be compatible with the latest version of PHP. It requires to be installed via composer, however, the developer has a web-based version of Rector which doesn’t require the installation.
  3. The PHP Upgrade Helper: This tool scans your codebase for deprecated and removed functions, methods, and constants in the latest version of PHP. It can be run on the command line or integrated into your development workflow.
  4. The PHP-Version-Matrix: This tool scans your codebase and compares it with the latest version of PHP, and it will also check if any of your dependencies are still compatible with the latest version of PHP.
  5. The PHP Compatibility Checker WordPress plugin: This plugin scans your WordPress site and plugins for compatibility with the latest version of PHP.

These tools can help you identify and fix the issues that may arise when updating to PHP 8, but keep in mind that

!(data:image/svg+xml,%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20version=%271.1%27%20width=%2730%27%20height=%2730%27/%3e)

These tools can help you identify and fix the issues that may arise when updating to PHP 8, but keep in mind that

even with these tools, there is always a risk of conflicts or issues arising when updating PHP. It’s always best to thoroughly test your website after any updates to ensure that everything is working as expected. Also even with these tools, there is always a risk of conflicts or issues arising when updating PHP. It’s always best to thoroughly test your website after any updates to ensure that everything is working as expected. Also, keep in mind that some of the mentioned tools may require some technical knowledge to use, so if you’re not comfortable with command-line interfaces or configuring development tools, it might be best to seek the help of a developer.

1 Like