@@ -84,11 +84,11 @@ module.exports = {
84
84
if ( type !== 1 ) {
85
85
const nameNode = this . node ( "identifier" ) ;
86
86
if ( type === 2 ) {
87
- if ( this . version >= 700 ) {
87
+ if ( this . engine . version >= 700 ) {
88
88
if ( this . token === this . tok . T_STRING || this . is ( "IDENTIFIER" ) ) {
89
89
name = this . text ( ) ;
90
90
this . next ( ) ;
91
- } else if ( this . version < 704 ) {
91
+ } else if ( this . engine . version < 704 ) {
92
92
this . error ( "IDENTIFIER" ) ;
93
93
}
94
94
} else if ( this . token === this . tok . T_STRING ) {
@@ -98,11 +98,11 @@ module.exports = {
98
98
this . error ( "IDENTIFIER" ) ;
99
99
}
100
100
} else {
101
- if ( this . version >= 700 ) {
101
+ if ( this . engine . version >= 700 ) {
102
102
if ( this . token === this . tok . T_STRING ) {
103
103
name = this . text ( ) ;
104
104
this . next ( ) ;
105
- } else if ( this . version >= 704 ) {
105
+ } else if ( this . engine . version >= 704 ) {
106
106
if ( ! this . expect ( "(" ) ) {
107
107
this . next ( ) ;
108
108
}
@@ -178,7 +178,7 @@ module.exports = {
178
178
result . push ( item ( ) ) ;
179
179
if ( this . token == "," ) {
180
180
this . next ( ) ;
181
- if ( this . version >= 800 && this . token === ")" ) {
181
+ if ( this . engine . version >= 800 && this . token === ")" ) {
182
182
return result ;
183
183
}
184
184
} else if ( this . token == ")" ) {
@@ -258,7 +258,7 @@ module.exports = {
258
258
let attrs = [ ] ;
259
259
if ( this . token === this . tok . T_ATTRIBUTE ) attrs = this . read_attr_list ( ) ;
260
260
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 ) {
262
262
if ( is_class_constructor ) {
263
263
this . next ( ) ;
264
264
readonly = true ;
@@ -273,7 +273,7 @@ module.exports = {
273
273
274
274
if (
275
275
! readonly &&
276
- this . version >= 801 &&
276
+ this . engine . version >= 801 &&
277
277
this . token === this . tok . T_READ_ONLY
278
278
) {
279
279
if ( is_class_constructor ) {
@@ -336,7 +336,10 @@ module.exports = {
336
336
// is the current token a:
337
337
// - | for union type
338
338
// - & 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
+ ) {
340
343
const nextToken = this . peek ( ) ;
341
344
342
345
if (
@@ -400,7 +403,7 @@ module.exports = {
400
403
let result = [ ] ;
401
404
this . expect ( "(" ) && this . next ( ) ;
402
405
if (
403
- this . version >= 801 &&
406
+ this . engine . version >= 801 &&
404
407
this . token === this . tok . T_ELLIPSIS &&
405
408
this . peek ( ) === ")"
406
409
) {
@@ -453,7 +456,7 @@ module.exports = {
453
456
) {
454
457
const nextToken = this . peek ( ) ;
455
458
if ( nextToken === ":" ) {
456
- if ( this . version < 800 ) {
459
+ if ( this . engine . version < 800 ) {
457
460
this . raiseError ( "PHP 8+ is required to use named arguments" ) ;
458
461
}
459
462
return this . node ( "namedargument" ) (
0 commit comments