@@ -42,7 +42,7 @@ public function tokenize($expression)
42
42
continue ;
43
43
}
44
44
45
- if (preg_match ('/[0-9]+(?:\.[0-9]+)?/A ' , $ expression , $ match , null , $ cursor )) {
45
+ if (preg_match ('/[0-9]+(?:\.[0-9]+)?/A ' , $ expression , $ match , 0 , $ cursor )) {
46
46
// numbers
47
47
$ number = (float ) $ match [0 ]; // floats
48
48
if (preg_match ('/^[0-9]+$/ ' , $ match [0 ]) && $ number <= PHP_INT_MAX ) {
@@ -69,19 +69,19 @@ public function tokenize($expression)
69
69
70
70
$ tokens [] = new Token (Token::PUNCTUATION_TYPE , $ expression [$ cursor ], $ cursor + 1 );
71
71
++$ cursor ;
72
- } elseif (preg_match ('/"([^" \\\\]*(?: \\\\.[^" \\\\]*)*)"| \'([^ \'\\\\]*(?: \\\\.[^ \'\\\\]*)*) \'/As ' , $ expression , $ match , null , $ cursor )) {
72
+ } elseif (preg_match ('/"([^" \\\\]*(?: \\\\.[^" \\\\]*)*)"| \'([^ \'\\\\]*(?: \\\\.[^ \'\\\\]*)*) \'/As ' , $ expression , $ match , 0 , $ cursor )) {
73
73
// strings
74
74
$ tokens [] = new Token (Token::STRING_TYPE , stripcslashes (substr ($ match [0 ], 1 , -1 )), $ cursor + 1 );
75
75
$ cursor += strlen ($ match [0 ]);
76
- } elseif (preg_match ('/not in(?=[\s(])|\!\=\=|not(?=[\s(])|and(?=[\s(])|\=\=\=|\>\=|or(?=[\s(])|\<\=|\*\*|\.\.|in(?=[\s(])|&&|\|\||matches|\=\=|\!\=|\*|~|%|\/|\>|\||\!|\^|&|\+|\<|\-/A ' , $ expression , $ match , null , $ cursor )) {
76
+ } elseif (preg_match ('/not in(?=[\s(])|\!\=\=|not(?=[\s(])|and(?=[\s(])|\=\=\=|\>\=|or(?=[\s(])|\<\=|\*\*|\.\.|in(?=[\s(])|&&|\|\||matches|\=\=|\!\=|\*|~|%|\/|\>|\||\!|\^|&|\+|\<|\-/A ' , $ expression , $ match , 0 , $ cursor )) {
77
77
// operators
78
78
$ tokens [] = new Token (Token::OPERATOR_TYPE , $ match [0 ], $ cursor + 1 );
79
79
$ cursor += strlen ($ match [0 ]);
80
80
} elseif (false !== strpos ('.,?: ' , $ expression [$ cursor ])) {
81
81
// punctuation
82
82
$ tokens [] = new Token (Token::PUNCTUATION_TYPE , $ expression [$ cursor ], $ cursor + 1 );
83
83
++$ cursor ;
84
- } elseif (preg_match ('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A ' , $ expression , $ match , null , $ cursor )) {
84
+ } elseif (preg_match ('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A ' , $ expression , $ match , 0 , $ cursor )) {
85
85
// names
86
86
$ tokens [] = new Token (Token::NAME_TYPE , $ match [0 ], $ cursor + 1 );
87
87
$ cursor += strlen ($ match [0 ]);
0 commit comments