JetBrains / JetBrains/phpstorm-attributes

php7.4 No attribute is effective.

Open
#35 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
416
Forks
11
PR merge metrics
No merged PRs in 30d

Description

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.

````

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.