src/Jit/TokenStream.php
public function next($type = false)
    {
        if ($type === false || $type === true) {
            $this->_current++;
            return $this->current($type);
        }
        $content = '';
        $start = $this->_current++;
        $count = $this->count();

        $list = array_fill_keys((array) $type, true);

        while ($this->_current < $count) {
            $content .= $this->_data[$this->_current][1];
            if (isset($list[$this->_data[$this->_current][0]])) {
                return $content;
            }
            $this->_current++;
        }
        $this->_current = $start;
    }
public function next($type = false)
    {
        if ($type === false || $type === true) {
            $this->_current++;
            return $this->current($type);
        }
        $content = '';
        $start = $this->_current++;
        $count = $this->count();

        $list = array_fill_keys((array) $type, true);

        while ($this->_current < $count) {
            $content .= $this->_data[$this->_current][1];
            if (isset($list[$this->_data[$this->_current][0]])) {
                return $content;
            }
            $this->_current++;
        }
        $this->_current = $start;
    }
public function next ( $ type = false ) { if ( $ type === false || $ type === true ) { $ this -> _current ++ ; return $ this -> current ( $ type ) ; } $ content = '' ; $ start = $ this -> _current ++ ; $ count = $ this -> count ( ) ; $ list = array_fill_keys ( ( array ) $ type , true ) ; while ( $ this -> _current < $ count ) { $ content .= $ this -> _data [ $ this -> _current ] [ 1 ] ; if ( isset ( $ list [ $ this -> _data [ $ this -> _current ] [ 0 ] ] ) ) { return $ content ; } $ this -> _current ++ ; } $ this -> _current = $ start ; }
Move to the next token of a given type.

@param  mixed       $type Token type to search for.
@return string|null Returns the skipped text content (the current is not saved).
Move to the next token of a given type .