Converts the value into object if needed.

@param int $index
2461
private function internalDataListUpdateValueIfNeeded(&$data, $index)
    {
        $value = $data[$index];
        if (is_callable($value)) {
            $value = call_user_func($value);
            $data[$index] = $value;
        }
        if (is_object($value)) {
            return $value;
        }
        $value = (object) $value;
        $data[$index] = $value;
        return $value;
    }
64002
public function get(int $index): ?int {
        if (isset($this->array[$index])) {
            return $this->array[$index];
        }
        return null;
    }
547620
public function at($index){
        $return = NULL;
        $index = intval($index);
        $data = $this->asArray();
        reset($data);
        if ($index < 0){
            $index += $this->length();
        }
        $c = 1;
        while ($c <= $index){
            next($data);
            $c++;
        }
        $return = current($data);
        $Model = $this->buildModel($return);
        if ($Model !== NULL){
            $return = $Model;
        }
        return $return;
    }
627542
public function drop($index)
    {
        $indexes = func_get_args();

        foreach ($indexes as $index) {
            $index = is_array($index) ? $this->prepareIndex($index) : $index;

            $this->collection->deleteIndex($index);
        }

        return $this;
    }
400926
public function pop($index = null)
    {
        if (is_null($index)) {
            return array_pop($this->source);
        }

        $previousValue = $this->offsetGet($index);

        array_splice($this->source, $index, 1);

        return $previousValue;
    }
988176
protected function map($index) // -> int
	{
		$r = $index;
		
		if( (null !== $index) && is_integer($index))
		{
			$r    = $index + $this->start;
			$size = $this->data->getSize();
			
			if($r >= $size)
			{
				$r -= $size;
			}
		}
		
		return $r;
	}
180873
public function withIndex(int $index): self
    {
        $state = clone $this;
        $state->_index = $index;
        return $state;
    }
198471
public function atIndex(int $index)
    {
        $i = 0;
        foreach ($this->items as $key => $value) {
            if ($i++ == $index) {
                return $value;
            }
        }

        return null;
    }
527248
public function hasIndex($index)
    {
        if ($index instanceof Index) {
            $index = $index->getName();
        }

        return \in_array($index, $this->_indices);
    }
868408
public function setIndex($index): self
    {
        if ($index instanceof Index) {
            $index = $index->getName();
        }
        $this->_metadata['_index'] = $index;

        return $this;
    }
231037
public Object remove(int index) {
        if (index < 0 || index >= values.size()) {
            return null;
        }
        return values.remove(index);
    }
188720
public static function IndexToContext( $index )
	{
		$result = array();
		foreach ( $index as $dimension => $members )
		{
			foreach ( $members as $memberQName => $member )
			{
				if ( is_array( $member ) )
				{
					$x = array( $memberQName => $member );
					// Remove the dimension from the member
					foreach ( $x as $key => $xml )
					{
						// $x[ $key ] =  str_replace( "</$memberQName>", "", str_replace( "<$memberQName>", "", $xml ) );
					}
					$result[] = array( 'dimension' => $dimension, 'member' => $x );
				}
				else
				{
					$result[] = array( 'dimension' => $dimension, 'member' => $member );
				}
			}
		}

		return $result;
	}
810250
public function getValue($index = 0)
    {
        if ($index === 0 && $this->value === null) {
            return $this->defaultValue;
        }

        return (is_array($this->value) && array_key_exists($index, $this->value))
            ? $this->value[$index]
            : null;
    }
769349
public function offsetSet($index, $value) {
		if( is_null($index) ){
			$this->results[] = $value;
			return;
		}
		$this->results[$index] = $value;
	}
256113
public function offsetUnset($index)
    {
        $this->value = \mb_substr($this->value, 0, $index) . \mb_substr($this->value, $index + 1);
        --$this->length;
    }
704327
public function remove($index)
	{
		if ($this->has($index))
		{
			Arr::forget($this->data, $index);
			Arr::forget($this->metas, $this->firstIndex($index));
		}

		return $this;
	}
406050
public void removeValue(int index) {

        m_content.removeValue(getPath(), getLocale(), index);

        // re-initialize the value list
        m_values = m_content.getValues(getPath(), getLocale());
    }