Skip to content

Conversation

VincentLanglet
Copy link
Contributor


$types = [new ArrayType(new MixedType(), new MixedType())];
foreach ($arrayKeys as $i => $arrayKey) {
$types[] = new HasOffsetValueType($arrayKey, $arrayValues[$i]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to have this limited to a few items, to prevent combinatorial explosion. 16 should be fine.

If there's more, just return plain array type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done with ddfa734

@ondrejmirtes ondrejmirtes merged commit de98821 into phpstan:2.1.x Sep 2, 2025
450 of 457 checks passed
@ondrejmirtes
Copy link
Member

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FP: object casted to array does not consider child class properties
2 participants