public static function arrayPathSet(array &$array, $path, $value, $glue='.')
    {
        if (!is_array($path)) {
            $path = explode($glue, (string) $path);
        }

        $ref = &$array;

        foreach ($path as $parent) {
            if (isset($ref) && !is_array($ref)) {
                $ref = array();
            }
            $ref = &$ref[$parent];
        }

        $ref = $value;
    }