# PHP

## Supported versions <a href="#supported-versions" id="supported-versions"></a>

The level of support for a language is defined as follows:

* Fully supported: Analysis will complete. All the language features are understood and examined.
* Supported: Most language features are understood and examined but the version includes unsupported features. Analysis might break or provide incomplete results.

Versions 5.0 to 8.4 are fully supported.

## Supported frameworks and tools <a href="#supported-frameworks-and-tools" id="supported-frameworks-and-tools"></a>

Laravel, Symfony, WordPress, Laminas, and Zend.

## Language-specific properties <a href="#language-specific-properties" id="language-specific-properties"></a>

To discover and update the PHP-specific properties, navigate in SonarQube Cloud to *Your Project* > **Administration** > **General Settings** > **Languages** > **PHP**. See [Configuration overview](/sonarqube-cloud/analyzing-source-code/analysis-parameters/configuration-overview.md) for more information about setting properties.

## Turning issues off <a href="#turning-issues-off" id="turning-issues-off"></a>

The best way to deactivate an individual issue you don’t intend to fix is to mark it as accepted or false positive through the Sonar UI.

If you need to deactivate a rule (or all rules) for an entire file, then issue exclusions are the way to go. But if you only want to deactivate a rule across a subset of a file - all the lines of a method or a class - you can use a PHPDoc comment `/* @SuppressWarnings("php:S2077") */` or an attribute `#[SuppressWarnings("php:S2077")]`.

## Analyze php.ini files <a href="#analyze-phpini-files" id="analyze-phpini-files"></a>

The PHP analyzer can analyze `php.ini` files with some specific rules (if these rules are activated in your quality profile). `php.ini` files must be part of the project you are analyzing, meaning the `php.ini` files have to be inside the directories listed in `sonar.sources`. Rules targeting `php.ini` files can be quickly identified through the *php-ini* tag set on them.

## Related pages <a href="#related-pages" id="related-pages"></a>

* Test coverage [Overview](/sonarqube-cloud/analyzing-source-code/test-coverage/overview.md)
* [External Analyzer Reports](/sonarqube-cloud/analyzing-source-code/importing-external-issues/external-analyzer-reports.md) ([PHPStan](https://phpstan.org/), [Psalm](https://psalm.dev/))


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/languages/php.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
