File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -3088,7 +3088,7 @@ protected function getTypeFromArrayDimFetch(
3088
3088
throw new ShouldNotHappenException ();
3089
3089
}
3090
3090
3091
- if ((new ObjectType (ArrayAccess::class))->isSuperTypeOf ($ offsetAccessibleType )->yes ()) {
3091
+ if (! $ offsetAccessibleType -> isArray ()-> yes () && (new ObjectType (ArrayAccess::class))->isSuperTypeOf ($ offsetAccessibleType )->yes ()) {
3092
3092
return $ this ->getType (
3093
3093
new MethodCall (
3094
3094
$ arrayDimFetch ->var ,
Original file line number Diff line number Diff line change @@ -3306,7 +3306,7 @@ private function processAssignVar(
3306
3306
$ valueToWrite = $ offsetValueType ->setOffsetValueType ($ offsetType , $ valueToWrite , $ i === 0 );
3307
3307
}
3308
3308
3309
- if (!(new ObjectType (ArrayAccess::class))->isSuperTypeOf ($ varType )->yes ()) {
3309
+ if ($ varType -> isArray ()-> yes () || !(new ObjectType (ArrayAccess::class))->isSuperTypeOf ($ varType )->yes ()) {
3310
3310
if ($ var instanceof Variable && is_string ($ var ->name )) {
3311
3311
$ scope = $ scope ->assignVariable ($ var ->name , $ valueToWrite );
3312
3312
} else {
@@ -3334,7 +3334,7 @@ private function processAssignVar(
3334
3334
}
3335
3335
}
3336
3336
3337
- if (!(new ObjectType (ArrayAccess::class))->isSuperTypeOf ($ varType )->no ()) {
3337
+ if (!$ varType -> isArray ()-> yes () && ! (new ObjectType (ArrayAccess::class))->isSuperTypeOf ($ varType )->no ()) {
3338
3338
$ throwPoints = array_merge ($ throwPoints , $ this ->processExprNode (
3339
3339
new MethodCall ($ var , 'offsetSet ' ),
3340
3340
$ scope ,
You can’t perform that action at this time.
0 commit comments