src/Helper/Arr.php
public static function set(array &$input, $namespace, $value, $separator = '.')
    {
        $keys  = explode($separator, $namespace);
        $pointer = &$input;

        while (count($keys) > 0) {
            $key = array_shift($keys);
            $pointer[$key] = isset($pointer[$key]) ? $pointer[$key] : [];
            $pointer = &$pointer[$key];
        }

        $pointer = $value;

        return $input;
    }
public static function set(array &$input, $namespace, $value, $separator = '.')
    {
        $keys  = explode($separator, $namespace);
        $pointer = &$input;

        while (count($keys) > 0) {
            $key = array_shift($keys);
            $pointer[$key] = isset($pointer[$key]) ? $pointer[$key] : [];
            $pointer = &$pointer[$key];
        }

        $pointer = $value;

        return $input;
    }
public static function set ( array & $ input , $ namespace , $ value , $ separator = '.' ) { $ keys = explode ( $ separator , $ namespace ) ; $ pointer = & $ input ; while ( count ( $ keys ) > 0 ) { $ key = array_shift ( $ keys ) ; $ pointer [ $ key ] = isset ( $ pointer [ $ key ] ) ? $ pointer [ $ key ] : [ ] ; $ pointer = & $ pointer [ $ key ] ; } $ pointer = $ value ; return $ input ; }
Sets a segmented string to an array

@param string $namespace
@param mixed  $value
@param array  $array
@param string $separator

@return array
Sets a segmented string to an array