/** * @return bool */ function valid() { return is_array($this->container) ? null !== $this->key() : $this->container->valid(); }