Skip to content

Commit

Permalink
['15' => 'a'] is internally [15 => 'a']
Browse files Browse the repository at this point in the history
  • Loading branch information
kkmuffme committed Mar 12, 2024
1 parent 4ea41cb commit 818dd0e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ public static function isContainedBy(
$key_type_comparison = new TypeComparisonResult();
if (!UnionTypeComparator::isContainedBy(
$codebase,
is_string($key) ? Type::getString($key) : Type::getInt(false, $key),
is_string($key) && (string) (int) $key !== $key
? Type::getString($key)
: Type::getInt(false, (int) $key),
$key_type,
false,
false,
Expand Down

0 comments on commit 818dd0e

Please sign in to comment.