Php-parser: Eval ignores closing tag

Created on 6 Mar 2018  路  1Comment  路  Source: glayzzle/php-parser

Input:

echo "hello"; ?> world

Running the code above in PHP's eval would result in:

php > eval('echo "hello"; ?> world');
    hello world

But the parser is failing with syntax error.

I also noticed that the following code will not result in error, and generates an AST with no children, while it should contain '?>?>' as inline:

parser.parseEval(`?>?>?>`)
bug LEXER

Most helpful comment

Hi @thiagorb,

Thanks for the report, it's fixed now and will be released on v3.0.0 soon

>All comments

Hi @thiagorb,

Thanks for the report, it's fixed now and will be released on v3.0.0 soon

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mgrip picture mgrip  路  3Comments

nevadascout picture nevadascout  路  3Comments

takashiki picture takashiki  路  7Comments

alexander-akait picture alexander-akait  路  3Comments

alexander-akait picture alexander-akait  路  3Comments