Linting and PHPCS changes for PHP 7.4-only applications

Following the availability of PHP 8.0 on WordPress VIP environments, a change is being made to the VIP Code Analysis Bot’s PHP multi-version linting abilities. Linting highlights code syntax and compilation errors. Starting today, all PHP files updated or added by pull requests will be linted using both PHP 7.4 and 8.0 for applications that currently only execute code using PHP 7.4. Before the change, sites running only PHP 7.4 would only be syntax checked with that particular PHP version.

The VIP Code Analysis Bot warning against a syntax problem in code using both PHP 7.4 and PHP 8.0. Before the change, only PHP 7.4 would have displayed an error in this case.

Similarly, the VIP Code Analysis Bot will also ask the PHPCompatibilityWP PHPCS standard to scan any added or changed code against PHP 8.0, instead of PHP 7.4 before. This change applies only to PHP 7.4 applications.

These changes are being made as PHP 7.4 will be going end-of-life soon, and all applications will be upgraded to PHP 8.0 by WordPress VIP in November 2022. The change will ensure any incompatibilities in new or altered code due to language changes in PHP 8.0 will be preemptively noted by the VIP Code Analysis Bot. Customers should review each incompatibility noted and apply a fix to the code as needed.

Please note that for applications that use other versions of PHP than PHP 7.4 or use any version combinations, there will be no change. Code added or altered by pull requests for these applications will be scanned only using the PHP versions they are configured to execute PHP code with. 

Customers should note that PHP linting by the VIP Code Analysis Bot of all files present in the relevant branch can be enabled rather than only modified files.

We recommend that steps posted in our initial lobby announcement are followed as soon as possible to make the transition to PHP 8.0 as smooth as possible.