Skip to content

Using attributes with PHP < 8.0 #7

@Mopolo

Description

@Mopolo

Hi!

On the anouncement page it says that some of these attributes work on older versions of PHP if used on a single line (so that PHP thinks they are comments).

However if PHPStorm is configured to sync settings with this composer.json:

{
    "require": {
        "php": "^7.4 | ^8.0"
    },
    "autoload": {
        "psr-4": {
            "Acme\\": "src"
        }
    }
}

Then the attribute is shown with an error:

image

And the error:

image

At the same time the attribute works in other code:

image

Is that the indented behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions