Skip to content

unsupported php types in lower php versions not detectedΒ #5629

@Tobion

Description

@Tobion

Bug report

We used a mixed type declarations on a parameter which is only available since PHP 8.
Testing this code with the highest phpstan level and running on PHP 7.4 did not report this as error.
But it should IMO as PHP 7.4 treated the mixed type as a class name which does not exist in the current namespace.

Code snippet that reproduces the problem

https://phpstan.org/r/6c15ac7b-d3c3-4d30-8df6-268c30ac4666

Expected output

Testing this with PHP 7.4 should show an error that mixed does not exist/is not available.

Did PHPStan help you today? Did it make you happy in any way?

Wasn't helpful today but certainly on other days ;)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions