protected function overwriteLastValueFromStructure(
        array &$structure,
        $value
    ) {
        $pointer = &$structure;
        $currentKey = key($pointer);
        $currentValue = &$pointer[$currentKey];
        while (is_array($currentValue)) {
            $pointer = &$currentValue;
            $currentKey = key($pointer);
            $currentValue = &$pointer[$currentKey];
        }

        $pointer[$currentKey] = $value;
    }