-
Notifications
You must be signed in to change notification settings - Fork 99
Open
Description
Hi,
I saw here a discussion start about PHP version.
Currently, It seems that phply is a mix between php 5.x and php 7.x.
For exemple this code is parsed like PHP 5.6.x:
yield $foo or die;Its returns Yield(BinaryOp(u'or', Variable(u'$foo'), Exit(None, u'die')))
instead of BinaryOp(u'or', Yield(Variable(u'$foo')), Exit(None, u'die'))
see yield is now a right associative operator
- Maybe phply could have a param to specify which version of PHP we want to parse ?
- Or maybe you could have a branch for each "X.Y" version of PHP ?
What do you think about it ? IMHO, solution 1 will be more useful: for ex, a script could try to parse a file with a specific version and fallback with another if there is a SyntaxError Exception raised by phply.
Once there will be a fixed php version for a context, we could fix this type of errors.
Metadata
Metadata
Assignees
Labels
No labels