private static function dereferenceDots(&$result, $references, $values)
    {
        $top = array_shift($references);

        $ref = end($references);
        while (key($references) !== null) {
            $values = array($ref => $values);
            $ref = prev($references);
        }

        if (array_key_exists($top, $result)) {
            $result[$top] = self::mergeTwoValues($result[$top], $values, array($top));
        }
        else {
            $result[$top] = $values;
        }
    }