Skip to content

How to do simple generics #5706

@szepeviktor

Description

@szepeviktor

Bug report

There is a function that receives a parameter of string|int and returns string or integer.

Code snippet that reproduces the problem

https://phpstan.org/r/984d90d3-9515-4250-8613-cfc69b719abf

Expected output

No error.

Please help me achieve this.
Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions