Skip to content

Array unions are improperly collapsed #3801

@gnarlyquack

Description

@gnarlyquack

Bug report

array{a, b}|array{c, d} is improperly collapsed as array{a|c, b|d}

Code snippet that reproduces the problem

https://phpstan.org/r/2fe252ba-d874-4f42-9164-d5672993d555

Expected output

Line 10: No error
Line 30: Function do_foo() should return array(true, null)|array(null, true) but returns ....
Actually, something (else) weird seems to be going on in line 30 since the reported "actual" type doesn't seem to make any sense.

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