1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-11-27 04:14:44 +01:00

Circumvent token_get_all bug with b"$var"

This commit is contained in:
nikic 2011-10-19 18:09:13 +02:00
parent 460f981e84
commit 9fba1df4e0

View File

@ -76,9 +76,16 @@ class PHPParser_Lexer
$token = $this->tokens[$this->pos];
if (is_string($token)) {
$value = $token;
$line = $this->line;
return ord($token);
$line = $this->line;
// bug in token_get_all
if ('b"' === $token) {
$value = 'b"';
return ord('"');
} else {
$value = $token;
return ord($token);
}
} else {
$this->line += substr_count($token[1], "\n");