File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ module.exports = {
29
29
this . next ( ) . expect ( "(" ) && this . next ( ) ;
30
30
const what = this . read_list ( this . read_namespace_name , "|" , false ) ;
31
31
let variable = null ;
32
- if ( this . token === this . tok . T_VARIABLE ) {
32
+ if ( this . version < 800 || this . token === this . tok . T_VARIABLE ) {
33
33
variable = this . read_variable ( true , false ) ;
34
34
}
35
35
this . expect ( ")" ) ;
Original file line number Diff line number Diff line change @@ -13,6 +13,14 @@ describe("boolean", () => {
13
13
parser . parseEval ( "try { call(); } catch (Exception) { do_something(); }" )
14
14
) . toMatchSnapshot ( ) ;
15
15
} ) ;
16
+ it ( "without variable in PHP < 8" , ( ) => {
17
+ expect ( ( ) =>
18
+ parser . parseEval (
19
+ "try { call(); } catch (Exception) { do_something(); }" ,
20
+ { parser : { version : "7.4" } }
21
+ )
22
+ ) . toThrow ( SyntaxError ) ;
23
+ } ) ;
16
24
it ( "qualified name" , ( ) => {
17
25
expect (
18
26
parser . parseEval (
You can’t perform that action at this time.
0 commit comments