Skip to content

Union of string literal and class-string<T> does not accept that string #10076

Open
phpstan/phpstan-src
#2707
@jrmajor

Description

Bug report

Parameter with 'object'|'array'|class-string<T> type does not accept 'object' or 'array'.

Code snippet that reproduces the problem

https://phpstan.org/r/2c18c29d-defd-4662-b5dc-8c0d56ad5126

Expected output

No errors should be reported in the snippet.

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

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions