public static function get(array $array, $key = null, $default = null, string $delimiter = null)
    {
        // Make loops easier for the end-user - return the initial array if the key is null instead of forcing
        // a valid value.
        if (!isset($key)) {
            return $array;
        }

        // Which string delimiter should we use?
        if (!isset($delimiter)) {
            $delimiter = static::$delimiter;
        }

        // If the key is string delimited, we need to explode it into an array of segments.
        $segments = is_array($key) ? $key : explode($delimiter, $key);

        // One dimension at a time.
        while ($segment = array_shift($segments)) {

            // If the current segment is a wildcard, make sure the it points to an array
            // and pluck the remaining segments from it.
            if ($segment === '*') {
                return is_array($array) ? static::pluck($array, $segments, $delimiter) : $default;
            }

            // Note: isset() is the cheapest condition to check for while being rather probable at the same time,
            // thus the seemingly unintuitive condition ordering.
            if (isset($array->{$segment})) {
                $array = $array->{$segment};
            } elseif (is_array($array) && array_key_exists($segment, $array)) {
                $array = $array[$segment];
            } else {
                return $default;
            }
        }

        return $array;
    }