Lines Matching defs:offset
91 * Whether an offset exists
95 * @phpstan-param int $offset
97 public function offsetExists($offset): bool
99 return \array_key_exists($offset, $this->elements);
107 * @phpstan-param int $offset
112 public function offsetGet($offset)
114 return $this->elements[$offset] ?? null;
122 * @phpstan-param int|null $offset
126 public function offsetSet($offset, $value): void
128 if ($offset === null) {
131 $this->elements[$offset] = $value;
140 * @phpstan-param int $offset
143 public function offsetUnset($offset): void
145 if (! \array_key_exists($offset, $this->elements)) {
149 unset($this->elements[$offset]);
159 public function slice(int $offset, ?int $length = null): array
161 return \array_slice($this->elements, $offset, $length, true);