Skip to content

Conditional return type for container #7141

@snapshotpl

Description

@snapshotpl

Bug report

I'd like to create stub for Container with conditional return type, however looks like is not possible to do that because bug or missing feature.

Code snippet that reproduces the problem

https://phpstan.org/r/b559c7cd-8851-4953-a7ec-0d8b5b3cc714

Expected output

No error and correct type

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