Skip to content

Dead catch is thrown for dynamic constructors #4806

@mabar

Description

@mabar

Bug report

Dead catch does not work with new $class();

Code snippet that reproduces the problem

https://phpstan.org/r/dd8f6b4f-22f8-4381-8e0b-8d92e07bf1d5

Expected output

Explained in snippet - createNotSpecified() and createMayThrowArgumentCountError() should not throw anything, createMayThrowArgumentCountErrorB() should throw different error.

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