src/lexer/comments.js
function() {
    let ch = this.input();
    let token = this.tok.T_COMMENT;
    if (ch === "*") {
      // started with '/*' , check is next is '*'
      ch = this.input();
      if (this.is_WHITESPACE()) {
        // check if next is WHITESPACE
        token = this.tok.T_DOC_COMMENT;
      }
      if (ch === "/") {
        return token;
      } else {
        this.unput(1); // reset
      }
    }
    while (this.offset < this.size) {
      ch = this.input();
      if (ch === "*" && this._input[this.offset] === "/") {
        this.input();
        break;
      }
    }
    return token;
  }
function() {
    let ch = this.input();
    let token = this.tok.T_COMMENT;
    if (ch === "*") {
      // started with '/*' , check is next is '*'
      ch = this.input();
      if (this.is_WHITESPACE()) {
        // check if next is WHITESPACE
        token = this.tok.T_DOC_COMMENT;
      }
      if (ch === "/") {
        return token;
      } else {
        this.unput(1); // reset
      }
    }
    while (this.offset < this.size) {
      ch = this.input();
      if (ch === "*" && this._input[this.offset] === "/") {
        this.input();
        break;
      }
    }
    return token;
  }
function ( ) { let ch = this . input ( ) ; let token = this . tok . T_COMMENT ; if ( ch === "*" ) { // started with '/*' , check is next is '*' ch = this . input ( ) ; if ( this . is_WHITESPACE ( ) ) { // check if next is WHITESPACE token = this . tok . T_DOC_COMMENT ; } if ( ch === "/" ) { return token ; } else { this . unput ( 1 ) ; // reset } } while ( this . offset < this . size ) { ch = this . input ( ) ; if ( ch === "*" && this . _input [ this . offset ] === "/" ) { this . input ( ) ; break ; } } return token ; }
Behaviour : https://github.com/php/php-src/blob/master/Zend/zend_language_scanner.l#L1927
Behaviour : https : // github . com / php / php - src / blob / master / Zend / zend_language_scanner . l#L1927