Retrieves offset from internal reference.
In case of a render array, it is wrapped again within a TwigReference object.
mixed $offset: The offset to retrieve.
mixed Returns a TwigReference object wrapping the array if the retrieved offset is a complex array (i.e. not an attribute). Else it returns the retrived offset directly.
public function offsetGet($offset) {
if (!is_array($this->writableRef[$offset]) || $offset[0] == '#') {
return $this->writableRef[$offset];
}
// Wrap the returned array in a new TwigReference.
$x = clone $this;
// clone is faster than new
$x
->setReference($this->writableRef[$offset]);
return $x;
}