Bug report
When using spread operator on class constant that contains an array of string constants, phpstan assumes its type wrong when used in another class array.
Simply, array of string constants is: string[]
Array in another class with spreaded array of constants should be: string[] but is array<int, string>|string[]
It seems that phpstan ignores the spread operator.
Code snippet that reproduces the problem
Behavior can be reproduced in phpstan playground:
https://phpstan.org/r/35d850a0-ec29-4afb-a773-e378c04d0e0a
Expected output
No errors expected.
Bug report
When using spread operator on class constant that contains an array of string constants, phpstan assumes its type wrong when used in another class array.
Simply, array of string constants is:
string[]Array in another class with spreaded array of constants should be:
string[]but isarray<int, string>|string[]It seems that phpstan ignores the spread operator.
Code snippet that reproduces the problem
Behavior can be reproduced in phpstan playground:
https://phpstan.org/r/35d850a0-ec29-4afb-a773-e378c04d0e0a
Expected output
No errors expected.