File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -232,17 +232,19 @@ private function parseCharacter($bIsForIdentifier) {
232232 return iconv ('utf-32le ' , $ this ->sCharset , $ sUtf32 );
233233 }
234234 if ($ bIsForIdentifier ) {
235- if (preg_match ('/[a-zA-Z0-9]|-|_/u ' , $ this ->peek ()) === 1 ) {
235+ $ peek = ord ($ this ->peek ());
236+ // Ranges: a-z A-Z 0-9 - _
237+ if (($ peek >= 97 && $ peek <= 122 ) ||
238+ ($ peek >= 65 && $ peek <= 90 ) ||
239+ ($ peek >= 48 && $ peek <= 57 ) ||
240+ ($ peek === 45 ) ||
241+ ($ peek === 95 ) ||
242+ ($ peek > 0xa1 )) {
236243 return $ this ->consume (1 );
237- } else if (ord ($ this ->peek ()) > 0xa1 ) {
238- return $ this ->consume (1 );
239- } else {
240- return null ;
241244 }
242245 } else {
243246 return $ this ->consume (1 );
244247 }
245- // Does not reach here
246248 return null ;
247249 }
248250
You can’t perform that action at this time.
0 commit comments