Skip to content

Commit 0966688

Browse files
committed
Fix problem caused by bug in PHP 5.3.
1 parent 0a34899 commit 0966688

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/Token.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,9 @@ public function extract()
254254
case Token::TYPE_SYMBOL:
255255
$str = $this->token;
256256
if ((isset($str[0])) && ($str[0] === '@')) {
257-
$str = mb_substr($str, 1, null, 'UTF-8');
257+
// `mb_strlen($str)` must be used instead of `null` because
258+
// in PHP 5.3- the `null` parameter isn't handled correctly.
259+
$str = mb_substr($str, 1, mb_strlen($str), 'UTF-8');
258260
}
259261
if ((isset($str[0])) && (($str[0] === '`')
260262
|| ($str[0] === '"') || ($str[0] === '\''))

0 commit comments

Comments
 (0)