data = $initial_value; } /* -( Conversion )--------------------------------------------------------- */ public function toArray() { return iterator_to_array($this, true); } /* -( Countable Interface )------------------------------------------------ */ #[\ReturnTypeWillChange] public function count() { return count($this->data); } /* -( Iterator Interface )------------------------------------------------- */ #[\ReturnTypeWillChange] public function current() { return current($this->data); } #[\ReturnTypeWillChange] public function key() { return key($this->data); } #[\ReturnTypeWillChange] public function next() { return next($this->data); } #[\ReturnTypeWillChange] public function rewind() { reset($this->data); } #[\ReturnTypeWillChange] public function valid() { return (key($this->data) !== null); } /* -( ArrayAccess Interface )---------------------------------------------- */ #[\ReturnTypeWillChange] public function offsetExists($key) { return array_key_exists($key, $this->data); } #[\ReturnTypeWillChange] public function offsetGet($key) { return $this->data[$key]; } #[\ReturnTypeWillChange] public function offsetSet($key, $value) { $this->data[$key] = $value; } #[\ReturnTypeWillChange] public function offsetUnset($key) { unset($this->data[$key]); } }