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;
    }
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;
    }
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 ; }
Overwrite the last child of a structure for given value.

@param array $structure
@param mixed $value
Overwrite the last child of a structure for given value .