Error recovery ----- ; ----- !!positions Syntax error, unexpected ';', expecting T_STRING or T_VARIABLE or '{' or '$' from 3:1 to 3:1 array( 0: Stmt_Expression[2:1 - 3:1]( expr: Expr_PropertyFetch[2:1 - 2:6]( var: Expr_Variable[2:1 - 2:4]( name: foo ) name: Expr_Error[3:1 - 2:6]( ) ) ) ) ----- } ----- !!positions Syntax error, unexpected '}', expecting T_STRING or T_VARIABLE or '{' or '$' from 4:1 to 4:1 array( 0: Stmt_Function[2:1 - 4:1]( byRef: false name: Identifier[2:10 - 2:12]( name: foo ) params: array( ) returnType: null stmts: array( 0: Stmt_Expression[3:5 - 3:10]( expr: Expr_PropertyFetch[3:5 - 3:10]( var: Expr_Variable[3:5 - 3:8]( name: bar ) name: Expr_Error[4:1 - 3:10]( ) ) ) ) ) ) ----- value $oopsAnotherValue->get() ]; $array = [ $value $oopsAnotherValue ]; $array = [ 'key' => $value $oopsAnotherValue ]; ----- !!php7 Syntax error, unexpected T_VARIABLE, expecting ',' or ')' or ']' from 3:18 to 3:34 Syntax error, unexpected T_VARIABLE, expecting ',' or ')' or ']' from 6:12 to 6:28 Syntax error, unexpected T_VARIABLE, expecting ',' or ')' or ']' from 9:21 to 9:37 array( 0: Stmt_Expression( expr: Expr_Assign( var: Expr_Variable( name: array ) expr: Expr_Array( items: array( 0: Expr_ArrayItem( key: null value: Expr_PropertyFetch( var: Expr_Variable( name: this ) name: Identifier( name: value ) ) byRef: false unpack: false ) 1: Expr_ArrayItem( key: null value: Expr_MethodCall( var: Expr_Variable( name: oopsAnotherValue ) name: Identifier( name: get ) args: array( ) ) byRef: false unpack: false ) ) ) ) ) 1: Stmt_Expression( expr: Expr_Assign( var: Expr_Variable( name: array ) expr: Expr_Array( items: array( 0: Expr_ArrayItem( key: null value: Expr_Variable( name: value ) byRef: false unpack: false ) 1: Expr_ArrayItem( key: null value: Expr_Variable( name: oopsAnotherValue ) byRef: false unpack: false ) ) ) ) ) 2: Stmt_Expression( expr: Expr_Assign( var: Expr_Variable( name: array ) expr: Expr_Array( items: array( 0: Expr_ArrayItem( key: Scalar_String( value: key ) value: Expr_Variable( name: value ) byRef: false unpack: false ) 1: Expr_ArrayItem( key: null value: Expr_Variable( name: oopsAnotherValue ) byRef: false unpack: false ) ) ) ) ) ) ----- if ($foo) { echo "foo"; $a->b(); } $c->d(); ----- !!php7 Syntax error, unexpected T_ECHO from 4:5 to 4:8 array( 0: Stmt_Expression( expr: Expr_ArrayDimFetch( var: Expr_MethodCall( var: Expr_Variable( name: obj ) name: Identifier( name: if ) args: array( 0: Arg( value: Expr_Variable( name: foo ) byRef: false unpack: false ) ) ) dim: Expr_Error( ) ) ) 1: Stmt_Expression( expr: Expr_MethodCall( var: Expr_Variable( name: c ) name: Identifier( name: d ) args: array( ) ) ) )