phpstorm-attributes
phpstorm-attributes copied to clipboard
php7.4 No attribute is effective.
PhpStorm 2025.1.2
https://blog.jetbrains.com/phpstorm/2020/10/phpstorm-2020-3-eap-4/
Fortunately, the syntax of one-line attributes is backward compatible. This means that if you add the #[ArrayShape] attribute in a separate line in your PHP 7.* project, the PHP interpreter will parse it as just a line comment and you won’t get a parse error. However, multiline attributes are not safe for versions of PHP prior to 8.
Unlike the PHP interpreter, PhpStorm will analyze attributes anyway! So even if your project runs on PHP 7.4 or lower, you still benefit from adding #[ArrayShape] attributes.