public function get($index, $valueIfEmpty = null)
    {
        if (!$this->offsetExists($index) && $valueIfEmpty !== null) {
            $this->offsetSet($index, $valueIfEmpty);
        }

        return $this->offsetGet($index);
    }
public function get($index, $valueIfEmpty = null)
    {
        if (!$this->offsetExists($index) && $valueIfEmpty !== null) {
            $this->offsetSet($index, $valueIfEmpty);
        }

        return $this->offsetGet($index);
    }
public function get ( $ index , $ valueIfEmpty = null ) { if ( ! $ this -> offsetExists ( $ index ) && $ valueIfEmpty !== null ) { $ this -> offsetSet ( $ index , $ valueIfEmpty ) ; } return $ this -> offsetGet ( $ index ) ; }
Retrieves a specific item from the Collection with its index.

Please note that this method (intentionally) has the side effect that whenever a key does not exist that it will
be created with the value provided by the $valueIfEmpty argument. This will allow for easy initialization during
tree building operations.

@param string|integer $index
@param mixed          $valueIfEmpty If the index does not exist it will be created with this value and returned.

@return mixed The contents of the element with the given index and the provided default if the key doesn't exist.
Retrieves a specific item from the Collection with its index .