How to check whether the PHP code is compatible with the exact PHP version in PhpStorm?

Question 

An old code should be converted to a newer PHP version. How could PhpStorm help with detecting backwards-incompatible updates?

Answer 

To make sure that the code is compatible with the exact PHP version:

  1. Open Settings | PHP | and set the PHP Language level to the desired one:
    Screenshot 2026-08-10 at 13.59.40.png

  2. Click on the root of the project in the Project tool window.

  3. In the main menu at the top of the IDE, select Code | Analyze Code | Run Inspection by name:
    RunInspectionByName.png

  4. Find the Language level inspection:

    LanguageLevelInspection.png

  5. Adjust Scope in the next window if required and press OK.

0 out of 0 found this helpful

Please sign in to leave a comment.

Have more questions?

Submit a request