Skip to content

"New in initializers" breaks in docblock #173

Open
@juampi92

Description

@juampi92

Bug report

Since PHP 8.1, it is possible to use new as default parameters ("new in initializers" RFC).

PHPStan gets it perfectly, but things stop working once we move them to docblocks, explicitly the @method docblock (see example).

Code snippet that reproduces the problem

https://phpstan.org/r/5d0cdcbb-5c11-4483-90b0-b95986f92bc2

Expected output

Since PHPStan understands the "new in initializers" in the code, I guess that this is a missed use-case instead of an actual bug, but I didn't know where to report it.

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

Every. single. day.

Thanks for this amazing tool!

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