Return result element at specified index (all messages, not roots)

@param int|string  $index  Element's index or "FIRST" or "LAST"

@return int Element value
355455
public function get_element($index)
    {
        $count = $this->count();

        if (!$count) {
            return null;
        }

        // first element
        if ($index === 0 || $index === '0' || $index === 'FIRST') {
            preg_match('/^([0-9]+)/', $this->raw_data, $m);
            $result = (int) $m[1];
            return $result;
        }

        // last element
        if ($index === 'LAST' || $index == $count-1) {
            preg_match('/([0-9]+)$/', $this->raw_data, $m);
            $result = (int) $m[1];
            return $result;
        }

        // do we know the position of the element or the neighbour of it?
        if (!empty($this->meta['pos'])) {
            $element = preg_quote(self::SEPARATOR_ELEMENT, '/');
            $item    = preg_quote(self::SEPARATOR_ITEM, '/') . '[0-9]+' . preg_quote(self::SEPARATOR_LEVEL, '/') .'?';
            $regexp  = '(' . $element . '|' . $item . ')';

            if (isset($this->meta['pos'][$index])) {
                if (preg_match('/([0-9]+)/', $this->raw_data, $m, null, $this->meta['pos'][$index]))
                    $result = $m[1];
            }
            else if (isset($this->meta['pos'][$index-1])) {
                // get chunk of data after previous element
                $data = substr($this->raw_data, $this->meta['pos'][$index-1]+1, 50);
                $data = preg_replace('/^[0-9]+/', '', $data); // remove UID at $index position
                $data = preg_replace("/^$regexp/", '', $data); // remove separator
                if (preg_match('/^([0-9]+)/', $data, $m))
                    $result = $m[1];
            }
            else if (isset($this->meta['pos'][$index+1])) {
                // get chunk of data before next element
                $pos  = max(0, $this->meta['pos'][$index+1] - 50);
                $len  = min(50, $this->meta['pos'][$index+1]);
                $data = substr($this->raw_data, $pos, $len);
                $data = preg_replace("/$regexp\$/", '', $data); // remove separator

                if (preg_match('/([0-9]+)$/', $data, $m))
                    $result = $m[1];
            }

            if (isset($result)) {
                return (int) $result;
            }
        }

        // Finally use less effective method
        $data = $this->get();

        return $data[$index];
    }
250744
public function getCell($index)
    {
        return isset($this->cells[$index]) ? $this->cells[$index] : null;
    }
90584
public function lastIndexOf($element) {
        for ($i = (count($this->_elements) - 1); $i > 0; $i--) {
            if ($element == $this->get($i)) { return $i; }
        }
    }
64002
public function get(int $index): ?int {
        if (isset($this->array[$index])) {
            return $this->array[$index];
        }
        return null;
    }
1221493
public function getItem($index) {
		if (is_int($index)&& isset($this->content[$index]))
			return $this->content[$index];
		else {
			$elm=$this->getElementById($index, $this->content);
			return $elm;
		}
	}
180538
public function get(int $index): string
    {
        return $this->handle->lIndex($this->name, $index);
    }
83196
public function getParamClean($index){
        if(isset($this->params[$index])){
            return $this->params[$index];
        }else{
            return NULL;
        }
    }
602833
public E get(final int index) {
        final int sz = size();
        if (index < 0 || index >= sz) {
            throw new NoSuchElementException(
                String.format("The specified index (%1$d) is outside the available range [0, %2$d)",
                    Integer.valueOf(index), Integer.valueOf(sz)));
        }

        final int idx = (start + index) % maxElements;
        return elements[idx];
    }
720301
public function getParam($index){
        if(isset($this->params[$index])){
            return $this->params[$index];
        }else{
            return NULL;
        }
    }
241679
private function getByIndex($index)
    {
        if (!isset($this->headers[$index])) {
            return null;
        }
        if ($this->headerObjects[$index] === null) {
            $this->headerObjects[$index] = $this->headerFactory->newInstance(
                $this->headers[$index][0],
                $this->headers[$index][1]
            );
        }
        return $this->headerObjects[$index];
    }
475248
public function getChildByIndex( $index )
	{
		if( $index > count( $this->children ) )
			throw new InvalidArgumentException( 'Child Node with Index "'.$index.'" is not existing.' );
		return $this->children[$index];
	}
318202
public function offsetGet($index)
    {
        foreach ((array)$this as $i => $element) {
            $i = (string)$i;
            if (is_string($element)) {
                continue;
            }
            if ($element instanceof Label
                && ($element->getElement()->name() == $index
                    || $i == $index
                )
            ) { 
                return $element;
            }
            if ($element->name() == $index || $i == $index) {
                return $element;
            }
            if ($element instanceof Element\Group
                and $found = $element[$index]
            ) {
                return $found;
            }
        }
        return null;
    }
173955
public function getContentByIndex($index)
    {
        $index = intval($index);
        return array_key_exists($index, $this->contents) ? $this->contents[$index] : null;
    }
1210462
public function get($index)
    {
        $focus = Aim::focus($index);

        if (!$focus->exists($this)) {
            throw new \OutOfBoundsException($index);
        }

        return $focus->get($this);
    }
519117
public function get($index)
    {
        $index = intval($index);
        $i = 0;
        foreach ($this->getInnerIterator() as $v) {
            if ($i == $index) {
                return $v;
            }
            $i++;
        }

        return null;
    }
1095237
public function getElement($index)
    {
        return (array_key_exists((int) $index, $this->elements) ? $this->elements[$index] : null);
    }
124751
public function get($index = 0)
        {
            if (is_integer($index)) {
                if ($index + 1 > $this->count()) {
                    return null;
                } else {
                    return Arrays::first(array_slice($this->_items, $index, 1));
                }
            } else {
                if ($this->has($index)) {
                    return $this->_items[$index];
                }
            }

            return null;
        }