Skip to content

crash on trait use: array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements #12327

@samsonasik

Description

@samsonasik

Bug report

When using trait use with alias, it cause crash:

array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements

on code:

trait SomeInternalTrait__TheNameIsIrrelevant
{
    public function something(){}
}

class DoesNotMatter
{
    use SomeInternalTrait__TheNameIsIrrelevant {
        SomeInternalTrait__TheNameIsIrrelevant::something as methodAlias; 
    }
    use ThisTriggersTheIssue;

    public function anything() {} 
}

Code snippet that reproduces the problem

https://phpstan.org/r/bdff2157-370f-4c2c-a205-67a7d7d08f33

Expected output

it should not crash

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions