public static function pluck($collection, string $property): array
    {
        $result = array_map(function ($value) use ($property) {
            if (is_array($value) && isset($value[$property])) {
                return $value[$property];
            } elseif (is_object($value) && isset($value->{$property})) {
                return $value->{$property};
            }
            foreach (__::split($property, '.') as $segment) {
                if (is_object($value)) {
                    if (isset($value->{$segment})) {
                        $value = $value->{$segment};
                    } else {
                        return null;
                    }
                } else {
                    if (isset($value[$segment])) {
                        $value = $value[$segment];
                    } else {
                        return null;
                    }
                }
            }

            return $value;
        }, (array)$collection);

        return array_values($result);
    }