How To Change Current Project PHP Version in PhpStorm 2022.2.2

How To Change Current Project PHP Version in PhpStorm 2022.2.2

Today, we’re going to look at a couple of methods for changing the current project’s PHP version in JetBrains PhpStorm 2022.2.2. While this method only applies to the currently opened project in PhpStorm, there is a way to change the default PHP version for new projects.

Take note of the current project’s PHP version by looking at the value in the Status Bar near the bottom right corner of the IDE window.

How To Change Current Project PHP Version in JetBrains PhpStorm 2022.2.2 - Configured PHP Language Level

Step 01: Change the PHP Version By Clicking on the Configured PHP Language Level Display Indicator in the Status Bar

The quickest and easiest method for changing the PHP level is simply to click the value in the status bar, then change it to the desired PHP level. I’m wanting to utilize PHP 8.1 in my project, so I’ll select that.

How To Change Current Project PHP Version in JetBrains PhpStorm 2022.2.2 - Change PHP Version From Status Bar

Alternate Method – Step 01: Click File > Settings… Menu to Open the Settings Panel

This method is a bit longer than the previous one, but it also lets you change additional settings in your project. You can modify the PHP CLI Interpreter, add include paths, change the PHP runtime or define unchecked exceptions.

How To Change Current Project PHP Version in JetBrains PhpStorm 2022.2.2 - File > Settings... Menu

Alternate Method – Step 02: Select the Desired PHP Language Level

Now we just select the dropdown under heading PHP language level and choose which version you’re changing to. There is also a brief description of some of the new features next to each language level. For instance, with PHP 8.1, enumerations, ‘never’ return type, intersection types, and ‘readonly’ properties are all new features.

How To Change Current Project PHP Version in JetBrains PhpStorm 2022.2.2 - Settings > PHP > PHP Language Level Update

And that’s it! Those are the two ways to update the current PhpStorm project’s PHP version.

What version of PHP are you using in your projects? Zend has published a blog post about PHP 7.4 nearing End-Of-Life (EOL) soon. Only Long-Term Support (LTS) will receive updates beyond November 28, 2022, so if you don’t have a migration plan, please consider implementing one.

PHP Version Release Date Active Support End Date End of Life / Security Support End Date Zend PHP 7.4 LTS End Date 
7.4 November 28, 2019  November 28, 2021 November 28, 2022 December 2026 

Join in the discussion below and let us know your favorite PHP version, your migration path or what features you’re looking forward to in PHP 8+.

All screenshots by Michael Smith.

Leave a Comment