return an item from an array with dottet dimensions

@param string		$key
@param array		$arr
@param mixed		$default
@return mixed
496398
public static function get( $key, $arr, $default = null ) 
	{
		if ( isset( $arr[$key] ) ) 
		{
			return $arr[$key];
		}

		if ( strpos( $key, '.' ) !== false ) 
		{
			$kp = explode( '.', $key );

			switch ( count( $kp ) ) 
			{
				case 2:
				if ( isset( $arr[$kp[0]][$kp[1]] ) ) 
				{
					return $arr[$kp[0]][$kp[1]]; 
				}
				break;
				case 3:
				if ( isset( $arr[$kp[0]][$kp[1]][$kp[2]] ) ) 
				{
					return $arr[$kp[0]][$kp[1]][$kp[2]]; 
				}
				break;	
				case 4:
				if ( isset( $arr[$kp[0]][$kp[1]][$kp[2]][$kp[3]] ) ) 
				{
					return $arr[$kp[0]][$kp[1]][$kp[2]][$kp[3]]; 
				}
				break;

				// if there are more then 4 parts loop trough them
				default:
					$curr = $arr;
					foreach( $kp as $k ) 
					{
						if ( isset( $curr[$k] ) ) {
							$curr = $curr[$k];
						} else { 
							return $default; 
						}
					}
					return $curr;
				break;
			}	
		}

		return $default;
	}
584859
public function get(string $key, $default = null)
    {
        if (array_key_exists($key, $this->input)) {
            return $this->input[$key];
        } elseif (array_key_exists($key, $this->cache)) {
            return $this->cache[$key];
        }

        // No dot, then not nested keys. We already tried that key and were not lucky.
        if (false === strpos($key, '.')) {
            return $this->default($default);
        }

        try {
            $return = $this->find($this->input, $key);
        } catch (\Exception $e) {
            $return = $this->default($default);
        }
        return $return;
    }
833433
protected function getRecursiveArrayParameter($key, $default = null)
    {
        $matches = array();
        preg_match_all($this->getRecursiveArrayRegex(), $key, $matches);

        $array = null;
        if(count($matches) === 3 && count($matches[0]) > 0) {
            $name = $matches[1][0];
            $array = $this->getParameter($name);
            foreach($matches[2] as $match) {
                $recursiveKey = str_replace(array('[', ']'), array('', ''), $match);
                if((is_array($array) || $array instanceof \ArrayAccess) && isset($array[$recursiveKey])) {
                    $array = $array[$recursiveKey];
                }
                else {
                    $array = null;
                }
            }
        }

        return $array ?: $default;
    }
1286686
public function get($key, $default = null)
    {
        $this->checkLoaded();

        return Arr::get($this->data, $key, $default);
    }
1326305
protected function arrayGet($key, $default = null)
    {
        if (isset($this->list[$key])) {
            return $this->list[$key];
        }

        foreach (explode('.', $key) as $segment) {
            if (! is_array($this->list) || ! array_key_exists($segment, $this->list)) {
                return (is_callable($default)) ? $default() : $default;
            }

            $this->list = $this->list[$segment];
        }

        return $this->list;
    }
1191853
public function get($key, $default = null)
    {
        return ArrayHelper::get($this->getItems(), $key, $default, $useDotSyntax = true);
    }
480570
public function getArray($key, array $default = array())
    {
        $value = $this->get($key, null);

        return null !== $value ? (array) $value : (array) $default;
    }
172342
public function get($key, $default = null)
    {
        if (
            ($value = $this->call('get', [$key, static::NOT_FOUND])) ===
            static::NOT_FOUND
        ) {
            $value = Arr::get($this->items, $key, $default);

            if (is_array($value)) {
                $value = $this->__wrap($value);
            }
        }

        return $value;
    }
804307
public function returnOrSet($key, $default = null)
    {
        if ($this->offsetExists($key)) {
            return $this->offsetGet($key);
        }
        $this->offsetSet($key, $default);

        return $default;
    }
35460
public static function get($array, $key, $default = null)
    {
        $key = static::normalizeKey($key);

        if ($key === null || $key === '')
        {
            return $array;
        }

        $keys = explode('.', $key);
        $currentElement = $array;

        foreach ($keys as $currentKey)
        {
            if (!is_array($currentElement) || !array_key_exists($currentKey, $currentElement))
            {
                return $default;
            }

            $currentElement = $currentElement[(string) $currentKey];
        }

        return $currentElement;
    }
873666
public function get($key = null, $default = null)
	{
		$return = $this->data;

		if ($key !== null) {
			$keys = explode('.', $key);

			foreach ($keys as $key) {
				if (isset($return[(string) $key])) {
					$return = $return[$key];
				} else {
					$return = $default;
					break;
				}
			}
		}

		return $return;
	}
1143959
public function getSafeArray(string $key, array & $data, string $default = null)
    {
        $value = $this->getFromArray($key, $data, $default);

        return \htmlspecialchars($value);
    }
474430
public function get($key, $default = null)
    {
        list($namespace, $group, $item) = $this->parseKey($key);

        $collection = $this->getCollection($group, $namespace);

        $this->load($group, $namespace, $collection);

        if (empty($item)) {
            return Arr::get($this->items, $collection, $default);
        }

        return Arr::get($this->items[$collection], $item, $default);
    }
659374
public function postFromArray(string $arrayName, string $key, $default = "") {
        $post = $this->_getPost();
        if (!is_array($post[$arrayName]) || !array_key_exists($key, $post[$arrayName])) {
            return $default;
        }
		$requestClass = $this->postAsRequestClass();
		$requestValues = $requestClass->value($arrayName, []);
        return $requestValues->value($key, $default);
    }
699367
public function get($key, $default = null)
    {
        $array = $this->objects;

        if (isset($array[$key])) {
            return $array[$key];
        }
        foreach (explode('\\', $key) as $segment) {
            if (!is_array($array) || !array_key_exists($segment, $array)) {
                return $default;
            }
            $array = $array[$segment];
        }
        return $array;
    }
431686
public function getAttributeFromArray($key, $default = null)
    {
        return isset($this->attributes[$key]) ? $this->attributes[$key] : $default;
    }
1330451
public function get($key, $default = null)
    {
        if (is_array($key)) {
            return $this->getMany($key);
        }

        return Arr::get($this->items, $key, $default);
    }