Skip to content

Commit 028898c

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: don't keep internal state between parser runs Add \Traversable typehint to phpdoc [ExpressionLanguage] Avoid dependency on ctype [Debug] Fix php notice
2 parents 269a0a7 + b181477 commit 028898c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lexer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function tokenize($expression)
4545
if (preg_match('/[0-9]+(?:\.[0-9]+)?/A', $expression, $match, null, $cursor)) {
4646
// numbers
4747
$number = (float) $match[0]; // floats
48-
if (ctype_digit($match[0]) && $number <= PHP_INT_MAX) {
48+
if (preg_match('/^[0-9]+$/', $match[0]) && $number <= PHP_INT_MAX) {
4949
$number = (int) $match[0]; // integers lower than the maximum
5050
}
5151
$tokens[] = new Token(Token::NUMBER_TYPE, $number, $cursor + 1);

0 commit comments

Comments
 (0)