“Expected parameter of type 'mixed[]', 'array' provided”

Go home PhpStorm! You’re drunk!

#PHP #PhpStorm

@ramsey not 100%, but I think `mixed[]` would be equivalent to `array<int,mixed>` (or `list<mixed>`), but `array` would be `array<string|int,mixed>`

Are you using associative arrays?

@stevegrunwell They’re associative, but I’m pretty sure `mixed[]` and `array` are both the same as `array<int|string, mixed>`.
Playground

@ramsey @stevegrunwell yeah they are the same, but personally when I read "array" I consider it "I don't know / I didn't apply types" while "mixed[]" reads a lot more intentional..
@alessandrolai @stevegrunwell I love when I use `mixed[]` and PhpStorm is like, “Did you mean to use `array`?”
@alessandrolai @stevegrunwell BTW, this is an actual inspection PhpStorm has. I don’t remember what it’s called, but I always turn it off in every project.