function next() {

		// Get next char from input, translated if necessary

		$c = $this->get();

		// Check comment possibility

		if ($c == '/') {

			// Look ahead : a comment is two slashes or slashes followed by asterisk (to be closed)

			switch ($this->peek()) {

				case '/' :

					// Comment is up to the end of the line
					$this->inPos = strpos($this->in, "\n", $this->inPos);
					return $this->in[$this->inPos];

				case '*' :

					// Comment is up to comment close.
					// Might not be terminated, if we hit the end of file.

					$this->inPos = strpos($this->in, "*/", $this->inPos);
					if ( $this->inPos === false ) {
						throw new MyJsMinException('UnterminatedComment');
					}
					$this->inPos += 2;
					return ' ';
				default :

					// Not a comment after all

					return $c;
			}
		}

		// No risk of a comment

		return $c;
	}
function next() {

		// Get next char from input, translated if necessary

		$c = $this->get();

		// Check comment possibility

		if ($c == '/') {

			// Look ahead : a comment is two slashes or slashes followed by asterisk (to be closed)

			switch ($this->peek()) {

				case '/' :

					// Comment is up to the end of the line
					$this->inPos = strpos($this->in, "\n", $this->inPos);
					return $this->in[$this->inPos];

				case '*' :

					// Comment is up to comment close.
					// Might not be terminated, if we hit the end of file.

					$this->inPos = strpos($this->in, "*/", $this->inPos);
					if ( $this->inPos === false ) {
						throw new MyJsMinException('UnterminatedComment');
					}
					$this->inPos += 2;
					return ' ';
				default :

					// Not a comment after all

					return $c;
			}
		}

		// No risk of a comment

		return $c;
	}
function next ( ) { // Get next char from input, translated if necessary $ c = $ this -> get ( ) ; // Check comment possibility if ( $ c == '/' ) { // Look ahead : a comment is two slashes or slashes followed by asterisk (to be closed) switch ( $ this -> peek ( ) ) { case '/' : // Comment is up to the end of the line $ this -> inPos = strpos ( $ this -> in , "\n" , $ this -> inPos ) ; return $ this -> in [ $ this -> inPos ] ; case '*' : // Comment is up to comment close. // Might not be terminated, if we hit the end of file. $ this -> inPos = strpos ( $ this -> in , "*/" , $ this -> inPos ) ; if ( $ this -> inPos === false ) { throw new MyJsMinException ( 'UnterminatedComment' ) ; } $ this -> inPos += 2 ; return ' ' ; default : // Not a comment after all return $ c ; } } // No risk of a comment return $ c ; }
Get the next character from the input stream, excluding comments.

{@link peek()} is used to see if a '/' is followed by a '*' or '/'.
Multiline comments are actually returned as a single space.

@return  string  The next character from the specified input stream, skipping comments.
@see     $in
Get the next character from the input stream excluding comments .