So, you mean to highlight all pieces of code that will not work with the PHP version you are writing it in, right? That can be done here:
Preferences -> Languages & Frameworks > PHP
and the same on Mac:
PhpStorm -> Preferences (⌘,) -> Languages & Frameworks > PHP
Or with newer versions of PhpStorm in Windows:
File -> Settings -> Languages & Frameworks > PHP

then select your PHP version, for example, 7.0
This is very useful when your local system runs PHP 7.0, for example, but production is running PHP 5.5.
That way PhpStorm will warn you which parts will not work in production, show proper hints during writing code according to the selected version, etc.
Answer from Alejandro Moreno on Stack OverflowImplement support for PhpStorm PHP 8 Attributes
ide - How can I set the PHP version in PHPStorm? - Stack Overflow
PhpStorm 2025.3 Is Now Out: PHP 8.5 support, Laravel Idea integrated, Pest 4 Support
PHP 8 Support
Videos
So, you mean to highlight all pieces of code that will not work with the PHP version you are writing it in, right? That can be done here:
Preferences -> Languages & Frameworks > PHP
and the same on Mac:
PhpStorm -> Preferences (⌘,) -> Languages & Frameworks > PHP
Or with newer versions of PhpStorm in Windows:
File -> Settings -> Languages & Frameworks > PHP

then select your PHP version, for example, 7.0
This is very useful when your local system runs PHP 7.0, for example, but production is running PHP 5.5.
That way PhpStorm will warn you which parts will not work in production, show proper hints during writing code according to the selected version, etc.
In case your field is disabled.
Probably your settings "Synchronize IDE settings with composer.json" is enabled
You may change your PHP version in composer.json file
"require": {
"php": ">=7.1.0",
}
OR disable your settings in this path
File -> Settings -> Languages & Frameworks > PHP > Composer
*If you change your composer.json file - As Félix Gagnon-Grenier commented, Keep in mind it has effects on the way packages will be required later
Does PHPStorm fully support PHP 8 at the moment?
I've seen mention of union types and attributes in some of the release notes so presumably they're good to go.
When I refactor a constructor to use property promotion it's flagged as a syntax error.
I have the language level set to "8.0 (union types)" and my composer.json file is requiring php:^8.0, but I'm not able to set the CLI Interpreter to PHP 8 yet because Homebrew hasn't released their package yet (I'd rather not get into building it from source).
I realise it's early days, so if it's not ready then that's okay, but I was wondering whether I had missed something.
I was messing around with PHP 8 and noticed that PhpStorm has some builtin attributes such as Immutable and ArrayShape. Kind of nice if only for documentation. There is a composer package to allow other static tools to possibly use them.
Given that you do end up with things like 'use JetBrains\PhpStorm\Pure;' in your source code, I was just wondering if other developers were planning to use these attributes? As opposed to perhaps waiting for some sort of 'standard' attributes to become available.