PopupMaker / Popup-Maker

Popup Maker plugin for WordPress
https://wppopupmaker.com/
104 stars 38 forks source link

PHP 8 Compatibility Check List #924

Open danieliser opened 3 years ago

danieliser commented 3 years ago

This list serves as an overview of the potential issues that cannot yet be ruled out that may affect the PM code base. Most should not be an issue.

Many pulled from: https://developer.yoast.com/blog/the-2020-wordpress-and-php-8-compatibility-report/

Named parameters

Support has also been added for named parameters. This has two major implications:

  1. Renaming parameters becomes a breaking change. If a parameter is renamed then anywhere that function is called with named parameters will break.
  2. The behaviour of call_user_func_array() changes. Previously call_user_func_array() could be called with an associative array. Now passing an associative array will be interpreted as using named parameters, which will cause an Exception to be thrown, if any of the named parameters do not exist.

API changes which could lead to type errors

Below we’ve compiled a list with some examples of API changes that will lead to type or argument errors where there were no indications as such in previous PHP versions.

Warnings converted to error exceptions

There are a large number of PHP warnings that have been changed to error exceptions in PHP 8.

Error level changes unrelated to RFC’s

The following warnings have been converted to errors probably related to deprecations in PHP 7.x versions:

Reclassified engine warnings

Lots of errors that previously only triggered warnings or notices, have been converted to errors. The following were changed:

Fatal error for incompatible method signatures

Inheritance errors due to incompatible method signatures between two classes will now throw a fatal error instead of a warning.

7.x deprecations

During the PHP 7.x release cycle, each version introduced new deprecations, which have now been finalized as feature removals in PHP 8. This also applies to some deprecation which were already put in place in PHP 5.x, but weren't removed in the PHP 7.0 release.

Most notably, the following, already deprecated features, have been removed in PHP 8:

danieliser commented 3 years ago

@fpcorso one tool I found mentioned that isn't terribly costly was this one: https://www.exakat.io/, example: https://www.exakat.io/reports/wordpress/

This was another: https://phpstan.org/