diff --git a/src/Type/ArrayType.php b/src/Type/ArrayType.php index b8487cde25..563beb29ee 100644 --- a/src/Type/ArrayType.php +++ b/src/Type/ArrayType.php @@ -179,6 +179,9 @@ public function getIterableKeyType(): Type if ($keyType instanceof StrictMixedType) { return new BenevolentUnionType([new IntegerType(), new StringType()]); } + if (!$keyType->isNumericString()->no()) { + return TypeCombinator::union(new IntegerType(), $keyType); + } return $keyType; }