Skip to content

Conversation

@Triplkrypl
Copy link

I found in crash way, that get_object_vars can return array with int key.

https://onlinephp.io/c/9a628

@staabm
Copy link
Contributor

staabm commented Nov 28, 2025

Can numeric keys only occur for objects without a class?

If so it might make sense to use a return type extension instead which can narrow the type depending on the context.

edit: and I think you should target PHPStan 2.1.x

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.

2 participants