Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Type/IntersectionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ class IntersectionType implements CompoundType

private ?TrinaryLogic $isOversizedArray = null;

private ?TrinaryLogic $isOffsetAccessible = null;

private ?TrinaryLogic $isIterableAtLeastOnce = null;

private ?TrinaryLogic $isConstantScalarValue = null;
Expand Down Expand Up @@ -862,7 +864,7 @@ public function looseCompare(Type $type, PhpVersion $phpVersion): BooleanType

public function isOffsetAccessible(): TrinaryLogic
{
return $this->intersectResults(static fn (Type $type): TrinaryLogic => $type->isOffsetAccessible());
return $this->isOffsetAccessible ??= $this->intersectResults(static fn (Type $type): TrinaryLogic => $type->isOffsetAccessible());
}

public function isOffsetAccessLegal(): TrinaryLogic
Expand Down
Loading