protected function optimizeOutConcatEqual()
	{
		// Start at offset 4 to skip the first four tokens: <?php $this->out.=
		$this->i = 3;

		while ($this->skipTo([T_CONCAT_EQUAL, '.=']))
		{
			// Test whether this T_CONCAT_EQUAL is preceded with $this->out
			if (!$this->isPrecededByOutputVar())
			{
				 continue;
			}

			while ($this->skipPast(';'))
			{
				// Test whether the assignment is followed by another $this->out.= assignment
				if (!$this->isOutputAssignment())
				{
					 break;
				}

				// Replace the semicolon between assignments with a concatenation operator
				$this->tokens[$this->i - 1] = '.';

				// Remove the following $this->out.= assignment and move the cursor past it
				unset($this->tokens[$this->i++]);
				unset($this->tokens[$this->i++]);
				unset($this->tokens[$this->i++]);
				unset($this->tokens[$this->i++]);
			}
		}
	}
protected function optimizeOutConcatEqual()
	{
		// Start at offset 4 to skip the first four tokens: <?php $this->out.=
		$this->i = 3;

		while ($this->skipTo([T_CONCAT_EQUAL, '.=']))
		{
			// Test whether this T_CONCAT_EQUAL is preceded with $this->out
			if (!$this->isPrecededByOutputVar())
			{
				 continue;
			}

			while ($this->skipPast(';'))
			{
				// Test whether the assignment is followed by another $this->out.= assignment
				if (!$this->isOutputAssignment())
				{
					 break;
				}

				// Replace the semicolon between assignments with a concatenation operator
				$this->tokens[$this->i - 1] = '.';

				// Remove the following $this->out.= assignment and move the cursor past it
				unset($this->tokens[$this->i++]);
				unset($this->tokens[$this->i++]);
				unset($this->tokens[$this->i++]);
				unset($this->tokens[$this->i++]);
			}
		}
	}
protected function optimizeOutConcatEqual ( ) { // Start at offset 4 to skip the first four tokens: <?php $this->out.= $ this -> i = 3 ; while ( $ this -> skipTo ( [ T_CONCAT_EQUAL , '.=' ] ) ) { // Test whether this T_CONCAT_EQUAL is preceded with $this->out if ( ! $ this -> isPrecededByOutputVar ( ) ) { continue ; } while ( $ this -> skipPast ( ';' ) ) { // Test whether the assignment is followed by another $this->out.= assignment if ( ! $ this -> isOutputAssignment ( ) ) { break ; } // Replace the semicolon between assignments with a concatenation operator $ this -> tokens [ $ this -> i - 1 ] = '.' ; // Remove the following $this->out.= assignment and move the cursor past it unset ( $ this -> tokens [ $ this -> i ++ ] ) ; unset ( $ this -> tokens [ $ this -> i ++ ] ) ; unset ( $ this -> tokens [ $ this -> i ++ ] ) ; unset ( $ this -> tokens [ $ this -> i ++ ] ) ; } } }
Optimize T_CONCAT_EQUAL assignments in an array of PHP tokens

Will only optimize $this->out.= assignments

@return void
Optimize T_CONCAT_EQUAL assignments in an array of PHP tokens