@@ -1171,9 +1171,10 @@ private function _processToken($token) {
1171
1171
break ;
1172
1172
1173
1173
case T_BRACES_OPEN : // {
1174
- $ this ->_processBracesOpen ($ token );
1174
+ if (!$ this ->_checkComplexVariable2 ($ token )) {
1175
+ $ this ->_processBracesOpen ($ token );
1176
+ }
1175
1177
break ;
1176
-
1177
1178
case T_BRACES_CLOSE : // }
1178
1179
$ this ->_processBracesClose ($ token );
1179
1180
break ;
@@ -1234,8 +1235,9 @@ private function _processToken($token) {
1234
1235
$ this ->_inString = !$ this ->_inString ;
1235
1236
break ;
1236
1237
case T_DOLLAR :
1237
- $ this ->_checkComplexVariable ($ token );
1238
- $ this ->_checkVariableVariable ($ token );
1238
+ if (!$ this ->_checkComplexVariable ($ token )) {
1239
+ $ this ->_checkVariableVariable ($ token );
1240
+ }
1239
1241
break ;
1240
1242
case T_ARRAY :
1241
1243
$ this ->_processArray ($ token );
@@ -3747,8 +3749,42 @@ private function _checkComplexVariable($token) {
3747
3749
3748
3750
// Skip the analysis of the content of the variable.
3749
3751
$ this ->tokenizer ->setCurrentPosition ($ closePos + 1 );
3752
+
3753
+ return true ;
3750
3754
}
3751
3755
}
3756
+
3757
+ return false ;
3758
+ }
3759
+
3760
+ /**
3761
+ * Check the use of a complex variable {$.
3762
+ *
3763
+ * Skip the analysis inside the variable.
3764
+ * Should be the token T_CURLY_OPEN but can also be T_BRACES_OPEN + T_DOLLAR
3765
+ *
3766
+ * Called when the current token is a single {.
3767
+ *
3768
+ * @param TokenInfo $token
3769
+ */
3770
+ private function _checkComplexVariable2 ($ token ) {
3771
+
3772
+ // Right after the { there is a $ with no space between
3773
+ if ($ this ->tokenizer ->checkNextToken (T_DOLLAR ) || ($ this ->tokenizer ->checkNextToken (T_VARIABLE ))) {
3774
+
3775
+ // Detect the end of the complexe variable
3776
+ $ closePos = $ this ->tokenizer ->findNextTokenPosition (T_BRACES_CLOSE );
3777
+
3778
+ if ($ closePos !== null ) {
3779
+
3780
+ // Skip the analysis of the content of the variable.
3781
+ $ this ->tokenizer ->setCurrentPosition ($ closePos + 1 );
3782
+
3783
+ return true ;
3784
+ }
3785
+ }
3786
+
3787
+ return false ;
3752
3788
}
3753
3789
3754
3790
/**
0 commit comments