File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ module.exports = {
2929 this . next ( ) . expect ( "(" ) && this . next ( ) ;
3030 const what = this . read_list ( this . read_namespace_name , "|" , false ) ;
3131 let variable = null ;
32- if ( this . token === this . tok . T_VARIABLE ) {
32+ if ( this . version < 800 || this . token === this . tok . T_VARIABLE ) {
3333 variable = this . read_variable ( true , false ) ;
3434 }
3535 this . expect ( ")" ) ;
Original file line number Diff line number Diff line change @@ -13,6 +13,14 @@ describe("boolean", () => {
1313 parser . parseEval ( "try { call(); } catch (Exception) { do_something(); }" )
1414 ) . toMatchSnapshot ( ) ;
1515 } ) ;
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+ } ) ;
1624 it ( "qualified name" , ( ) => {
1725 expect (
1826 parser . parseEval (
You can’t perform that action at this time.
0 commit comments