Fix get_object_vars() return type#4580
Conversation
|
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 |
Not exactly classes extending $obj = new \stdClass();
$obj->{1} = 42;If anyone want make dynamic return type detection, condition only for class is not enough.
I am not sure if you support fixes for function interfaces in phpstan version 1. |
Is there a reason you still use version 1? |
I not use version 1 what i know and not need it, but my question is. If you make fixes of PHP function interfaces in version 1, if not i will update pull request to version 2. |
|
At this point in time 1.x only sees critical fixes. Everything else goes into 2.1.x right now |
I found in crash way, that
get_object_varscan returnarraywithintkey.https://onlinephp.io/c/9a628