protected function stripAssignmentFlags(&$value)
    {
        $flags = [];

        for ($token = &$value; $token[0] === Type::T_LIST && ($s = count($token[2])); $token = &$lastNode) {
            $lastNode = &$token[2][$s - 1];

            while ($lastNode[0] === Type::T_KEYWORD && in_array($lastNode[1], ['!default', '!global'])) {
                array_pop($token[2]);

                $node = end($token[2]);

                $token = $this->flattenList($token);

                $flags[] = $lastNode[1];

                $lastNode = $node;
            }
        }

        return $flags;
    }