Skip to content

Report invalid constructor property promotion for readonly props already defined in parent class constructor #8101

@ZebulanStanphill

Description

@ZebulanStanphill

Feature request

Declaring a child class with constructor property promotion for a property already declared in the parent class' constructor throws a fatal error at runtime when the child class is instantiated. PHPStan does not currently report this.

https://3v4l.org/oLdjg#v8.1.11

https://phpstan.org/r/cf781e9e-cfdd-4aae-855d-ead64bf16afa

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

I saw that full support for the list type was recently introduced. Definitely looking forward to that.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions