@@ -199,13 +199,13 @@ module.exports = {
199199 case this . tok . T_INC :
200200 return this . node ( "pre" ) (
201201 "+" ,
202- this . next ( ) . read_variable ( false , false , false )
202+ this . next ( ) . read_variable ( false , false )
203203 ) ;
204204
205205 case this . tok . T_DEC :
206206 return this . node ( "pre" ) (
207207 "-" ,
208- this . next ( ) . read_variable ( false , false , false )
208+ this . next ( ) . read_variable ( false , false )
209209 ) ;
210210
211211 case this . tok . T_NEW :
@@ -341,7 +341,7 @@ module.exports = {
341341 // SCALAR | VARIABLE
342342 if ( this . is ( "VARIABLE" ) ) {
343343 result = this . node ( ) ;
344- expr = this . read_variable ( false , false , false ) ;
344+ expr = this . read_variable ( false , false ) ;
345345
346346 // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L877
347347 // should accept only a variable
@@ -355,13 +355,14 @@ module.exports = {
355355 if ( isConst ) this . error ( "VARIABLE" ) ;
356356 let right ;
357357 if ( this . next ( ) . token == "&" ) {
358+ right = this . node ( 'byref' ) ;
358359 if ( this . next ( ) . token === this . tok . T_NEW ) {
359360 if ( this . php7 ) {
360361 this . error ( ) ;
361362 }
362- right = this . read_new_expr ( ) ;
363+ right = right ( this . read_new_expr ( ) ) ;
363364 } else {
364- right = this . read_variable ( false , false , true ) ;
365+ right = right ( this . read_variable ( false , false ) ) ;
365366 }
366367 } else {
367368 right = this . read_expr ( ) ;
@@ -511,7 +512,7 @@ module.exports = {
511512 }
512513 return result ;
513514 } else if ( this . is ( "VARIABLE" ) ) {
514- return this . read_variable ( true , false , false ) ;
515+ return this . read_variable ( true , false ) ;
515516 } else {
516517 this . expect ( [ this . tok . T_STRING , "VARIABLE" ] ) ;
517518 }
0 commit comments