private function moveTokens(Tokens $tokens, $start, $end, $to)
    {
        $added = 0;
        for ($i = $start + 1; $i < $end; $i += 2) {
            if ($tokens[$i]->isWhitespace() && $tokens[$to + 1]->isWhitespace()) {
                $tokens[$to + 1] = new Token([T_WHITESPACE, $tokens[$to + 1]->getContent().$tokens[$i]->getContent()]);
            } else {
                $tokens->insertAt(++$to, clone $tokens[$i]);
                ++$end;
                ++$added;
            }

            $tokens->clearAt($i + 1);
        }

        return $added;
    }
private function moveTokens(Tokens $tokens, $start, $end, $to)
    {
        $added = 0;
        for ($i = $start + 1; $i < $end; $i += 2) {
            if ($tokens[$i]->isWhitespace() && $tokens[$to + 1]->isWhitespace()) {
                $tokens[$to + 1] = new Token([T_WHITESPACE, $tokens[$to + 1]->getContent().$tokens[$i]->getContent()]);
            } else {
                $tokens->insertAt(++$to, clone $tokens[$i]);
                ++$end;
                ++$added;
            }

            $tokens->clearAt($i + 1);
        }

        return $added;
    }
private function moveTokens ( Tokens $ tokens , $ start , $ end , $ to ) { $ added = 0 ; for ( $ i = $ start + 1 ; $ i < $ end ; $ i += 2 ) { if ( $ tokens [ $ i ] -> isWhitespace ( ) && $ tokens [ $ to + 1 ] -> isWhitespace ( ) ) { $ tokens [ $ to + 1 ] = new Token ( [ T_WHITESPACE , $ tokens [ $ to + 1 ] -> getContent ( ) . $ tokens [ $ i ] -> getContent ( ) ] ) ; } else { $ tokens -> insertAt ( ++ $ to , clone $ tokens [ $ i ] ) ; ++ $ end ; ++ $ added ; } $ tokens -> clearAt ( $ i + 1 ) ; } return $ added ; }
@param Tokens $tokens
@param int    $start  Index previous of the first token to move
@param int    $end    Index of the last token to move
@param int    $to     Upper boundary index

@return int Number of tokens inserted
@param Tokens $tokens @param int $start Index previous of the first token to move @param int $end Index of the last token to move @param int $to Upper boundary index