public function get($key = null, $default = null)
    {
        if (is_null($key)) {
            return $this->elements;
        }
        if ($this->exists($this->elements, $key)) {
            return $this->elements[$key];
        }
        if (strpos($key, '.') === false) {
            return $default;
        }
        $items = $this->elements;
        foreach (explode('.', $key) as $segment) {
            if (!is_array($items) || !$this->exists($items, $segment)) {
                return $default;
            }
            $items = &$items[$segment];
        }
        return $items;
    }
public function get($key = null, $default = null)
    {
        if (is_null($key)) {
            return $this->elements;
        }
        if ($this->exists($this->elements, $key)) {
            return $this->elements[$key];
        }
        if (strpos($key, '.') === false) {
            return $default;
        }
        $items = $this->elements;
        foreach (explode('.', $key) as $segment) {
            if (!is_array($items) || !$this->exists($items, $segment)) {
                return $default;
            }
            $items = &$items[$segment];
        }
        return $items;
    }
public function get ( $ key = null , $ default = null ) { if ( is_null ( $ key ) ) { return $ this -> elements ; } if ( $ this -> exists ( $ this -> elements , $ key ) ) { return $ this -> elements [ $ key ] ; } if ( strpos ( $ key , '.' ) === false ) { return $ default ; } $ items = $ this -> elements ; foreach ( explode ( '.' , $ key ) as $ segment ) { if ( ! is_array ( $ items ) || ! $ this -> exists ( $ items , $ segment ) ) { return $ default ; } $ items = & $ items [ $ segment ] ; } return $ items ; }
Return the value of a given key

@param  int|string|null $key
@param  mixed           $default
@return mixed
Return the value of a given key