Skip to content

Reflection error for the attribute ReturnTypeWillChange on PHP 7.1-7.4 #6414

@lysyjan

Description

@lysyjan

Bug report

We use PHPStan with two PHP versions. With the latest 8.1 and the older 7.2. If we use the annotation ReturnTypeWillChange, then PHPStan running on PHP 7.2 reports the error Reflection error: Attribute not found. But when we remove the annotation then it reports an error with PHP 8.1.

Code snippet that reproduces the problem

Link with the code.

Expected output

No error on PHP 7.1 - 7.4

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