@@ -84,11 +84,11 @@ module.exports = {
8484 if ( type !== 1 ) {
8585 const nameNode = this . node ( "identifier" ) ;
8686 if ( type === 2 ) {
87- if ( this . version >= 700 ) {
87+ if ( this . engine . version >= 700 ) {
8888 if ( this . token === this . tok . T_STRING || this . is ( "IDENTIFIER" ) ) {
8989 name = this . text ( ) ;
9090 this . next ( ) ;
91- } else if ( this . version < 704 ) {
91+ } else if ( this . engine . version < 704 ) {
9292 this . error ( "IDENTIFIER" ) ;
9393 }
9494 } else if ( this . token === this . tok . T_STRING ) {
@@ -98,11 +98,11 @@ module.exports = {
9898 this . error ( "IDENTIFIER" ) ;
9999 }
100100 } else {
101- if ( this . version >= 700 ) {
101+ if ( this . engine . version >= 700 ) {
102102 if ( this . token === this . tok . T_STRING ) {
103103 name = this . text ( ) ;
104104 this . next ( ) ;
105- } else if ( this . version >= 704 ) {
105+ } else if ( this . engine . version >= 704 ) {
106106 if ( ! this . expect ( "(" ) ) {
107107 this . next ( ) ;
108108 }
@@ -178,7 +178,7 @@ module.exports = {
178178 result . push ( item ( ) ) ;
179179 if ( this . token == "," ) {
180180 this . next ( ) ;
181- if ( this . version >= 800 && this . token === ")" ) {
181+ if ( this . engine . version >= 800 && this . token === ")" ) {
182182 return result ;
183183 }
184184 } else if ( this . token == ")" ) {
@@ -258,7 +258,7 @@ module.exports = {
258258 let attrs = [ ] ;
259259 if ( this . token === this . tok . T_ATTRIBUTE ) attrs = this . read_attr_list ( ) ;
260260
261- if ( this . version >= 801 && this . token === this . tok . T_READ_ONLY ) {
261+ if ( this . engine . version >= 801 && this . token === this . tok . T_READ_ONLY ) {
262262 if ( is_class_constructor ) {
263263 this . next ( ) ;
264264 readonly = true ;
@@ -273,7 +273,7 @@ module.exports = {
273273
274274 if (
275275 ! readonly &&
276- this . version >= 801 &&
276+ this . engine . version >= 801 &&
277277 this . token === this . tok . T_READ_ONLY
278278 ) {
279279 if ( is_class_constructor ) {
@@ -336,7 +336,10 @@ module.exports = {
336336 // is the current token a:
337337 // - | for union type
338338 // - & for intersection type (> php 8.1)
339- while ( this . token === "|" || ( this . version >= 801 && this . token === "&" ) ) {
339+ while (
340+ this . token === "|" ||
341+ ( this . engine . version >= 801 && this . token === "&" )
342+ ) {
340343 const nextToken = this . peek ( ) ;
341344
342345 if (
@@ -400,7 +403,7 @@ module.exports = {
400403 let result = [ ] ;
401404 this . expect ( "(" ) && this . next ( ) ;
402405 if (
403- this . version >= 801 &&
406+ this . engine . version >= 801 &&
404407 this . token === this . tok . T_ELLIPSIS &&
405408 this . peek ( ) === ")"
406409 ) {
@@ -453,7 +456,7 @@ module.exports = {
453456 ) {
454457 const nextToken = this . peek ( ) ;
455458 if ( nextToken === ":" ) {
456- if ( this . version < 800 ) {
459+ if ( this . engine . version < 800 ) {
457460 this . raiseError ( "PHP 8+ is required to use named arguments" ) ;
458461 }
459462 return this . node ( "namedargument" ) (
0 commit comments