src/Collection/DotNotationCollection.php
public function get(string $path, $default = null)
    {
        $array = $this->items;

        if (!empty($path)) {
            $keys = $this->explode($path);
            foreach ($keys as $key) {
                if (!array_key_exists($key, $array)) {
                    return $default;
                }
                $array = $array[$key];
            }
        }

        return $array;
    }
public function get(string $path, $default = null)
    {
        $array = $this->items;

        if (!empty($path)) {
            $keys = $this->explode($path);
            foreach ($keys as $key) {
                if (!array_key_exists($key, $array)) {
                    return $default;
                }
                $array = $array[$key];
            }
        }

        return $array;
    }
public function get ( string $ path , $ default = null ) { $ array = $ this -> items ; if ( ! empty ( $ path ) ) { $ keys = $ this -> explode ( $ path ) ; foreach ( $ keys as $ key ) { if ( ! array_key_exists ( $ key , $ array ) ) { return $ default ; } $ array = $ array [ $ key ] ; } } return $ array ; }
Return a path value
@param string $path
@param mixed $default
@return mixed
Return a path value