facebookarchive / pfff

Tools for code analysis, visualizations, or style-preserving source transformation.
http://github.com/facebook/pfff/wiki/Main
Other
2.44k stars 204 forks source link

php parsing issue #127

Open jcberleur opened 9 years ago

jcberleur commented 9 years ago

I get "warning: parsing problem in FILE" when using sgrep on a file with parent in a namespace while working in php/hhvm

<?php

namespace foo\parent\bar {
    class Foo { }
}

namespace {
    $foo = new foo\parent\bar\Foo();
    var_dump($foo);
}
aryx commented 9 years ago

Yes it's because parent is considered a keyword. IMHO you should not use namespace names which happen to also be keywords. I know the official PHP languages allows that, but I'm not sure it's a good idea.