protected function mergeConcatenatedStrings()
	{
		if ($this->tokens[$this->i - 1][0]    !== T_CONSTANT_ENCAPSED_STRING
		 || $this->tokens[$this->i + 1][0]    !== T_CONSTANT_ENCAPSED_STRING
		 || $this->tokens[$this->i - 1][1][0] !== $this->tokens[$this->i + 1][1][0])
		{
			return false;
		}

		// Merge both strings into the right string
		$this->tokens[$this->i + 1][1] = substr($this->tokens[$this->i - 1][1], 0, -1)
		                               . substr($this->tokens[$this->i + 1][1], 1);

		// Unset the tokens that have been optimized away
		unset($this->tokens[$this->i - 1]);
		unset($this->tokens[$this->i]);

		// Advance the cursor
		++$this->i;

		return true;
	}
protected function mergeConcatenatedStrings()
	{
		if ($this->tokens[$this->i - 1][0]    !== T_CONSTANT_ENCAPSED_STRING
		 || $this->tokens[$this->i + 1][0]    !== T_CONSTANT_ENCAPSED_STRING
		 || $this->tokens[$this->i - 1][1][0] !== $this->tokens[$this->i + 1][1][0])
		{
			return false;
		}

		// Merge both strings into the right string
		$this->tokens[$this->i + 1][1] = substr($this->tokens[$this->i - 1][1], 0, -1)
		                               . substr($this->tokens[$this->i + 1][1], 1);

		// Unset the tokens that have been optimized away
		unset($this->tokens[$this->i - 1]);
		unset($this->tokens[$this->i]);

		// Advance the cursor
		++$this->i;

		return true;
	}
protected function mergeConcatenatedStrings ( ) { if ( $ this -> tokens [ $ this -> i - 1 ] [ 0 ] !== T_CONSTANT_ENCAPSED_STRING || $ this -> tokens [ $ this -> i + 1 ] [ 0 ] !== T_CONSTANT_ENCAPSED_STRING || $ this -> tokens [ $ this -> i - 1 ] [ 1 ] [ 0 ] !== $ this -> tokens [ $ this -> i + 1 ] [ 1 ] [ 0 ] ) { return false ; } // Merge both strings into the right string $ this -> tokens [ $ this -> i + 1 ] [ 1 ] = substr ( $ this -> tokens [ $ this -> i - 1 ] [ 1 ] , 0 , - 1 ) . substr ( $ this -> tokens [ $ this -> i + 1 ] [ 1 ] , 1 ) ; // Unset the tokens that have been optimized away unset ( $ this -> tokens [ $ this -> i - 1 ] ) ; unset ( $ this -> tokens [ $ this -> i ] ) ; // Advance the cursor ++ $ this -> i ; return true ; }
Merge concatenated strings together

Must be called when the cursor is at the concatenation operator

@return bool Whether strings were merged
Merge concatenated strings together