contexts); } public function offsetGet(mixed $offset): mixed { return $this->contexts[$offset] ?? null; } public function offsetSet(mixed $offset, mixed $value): void { $this->contexts[$offset ?? count($this->contexts)] = $value; } public function offsetUnset(mixed $offset): void { unset($this->contexts[$offset]); } public function count(): int { return count($this->contexts); } public function getIterator(): \Traversable { foreach ($this->contexts as $k => $c) { yield $k => $c; } } public function __construct(Context ...$context) { $this->contexts = $context; } }