Title: PHP linting
Author: WordPress VIP Documentation
Published: August 2, 2021
Last modified: December 31, 2025

---

 1. [VIP Code Analysis Bot](https://docs.wpvip.com/vip-code-analysis-bot/)
 2. PHP linting

#  PHP linting

The [VIP Code Analysis Bot](https://docs.wpvip.com/vip-code-analysis-bot/) runs 
the [PHP linter](https://www.php.net/manual/en/features.commandline.options.php)
that is bundled with PHP (`php -l`) to highlight code syntax and compilation errors.

By default, only modified PHP files in a repository’s pull request are PHP linted
by the Bot. It is possible to configure the Bot to [PHP lint _all_ files](https://docs.wpvip.com/customize-the-bot/#h-lint-modified-files-only)
if needed.

## Syntax checks

VIP configures the Bot to check the syntax of each altered file, as syntax errors
are often fatal. The Bot safeguards against such fatal errors as they usually need
to be addressed before deployment.

In some cases, code might intentionally contain syntax errors, such as files that
are part of unit-test packages. [Customizing the Bot’s behavior](https://docs.wpvip.com/customize-the-bot/)
is useful to prevent that code from being unnecessarily highlighted during PHP linting.

![](https://docs.wpvip.com/wp-content/uploads/sites/2/2022/03/code-analysis-bot-
php-lint-issues.png?w=1024)

An example of feedback from the Bot highlighting errors found by PHP linting

## PHP versions

VIP has configured the Bot to PHP lint each file based on the PHP versions used 
in the environments to which the repository deploys.

A repository can deploy to more than one [application](https://docs.wpvip.com/application/),
and an application on VIP typically includes multiple [environments](https://docs.wpvip.com/vip-platform/environments/),
which can run different versions of PHP. For example, if a particular repository
deploys to two environments, one using PHP 8.0 and the other PHP 8.2, files will
be PHP linted using both PHP 8.0 and PHP 8.2.

For repositories that deploy to applications with environments where only PHP version
8.0 is running, all PHP files updated or added by pull requests will be linted using
both PHP 8.0 _and_ 8.2. This is done to prepare applications for the upgrade to 
PHP 8.2 and ensures that any incompatibilities in new or altered code due to language
changes in PHP 8.2 will be preemptively noted by the VIP Code Analysis Bot.

Last updated: December 31, 2025