-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug in parser? [] causes the phpcompatinfot o skip file #239
Comments
Hello, and thanks for reporting BTW, this list short syntax was implemented in PHP 7.1 I understand that we should not be able to parse code on PHP platform 7.1 or greater with compatinfo 5.0 Be aware that a new major version 6.0 is on way (branch 5.1 was canceled and will be remove in next days). See note. As the php-parser version 2.x was implemented in php-reflect, I've to release a new version 4.2 of this one to avoid installation on PHP plateform 7.1+ Stay tuned. |
Finally, I've decided to not block installation with plateform 7.1 or 7.2. Reason: it's not necessary (especially if you want to use other features) and will not solved this issue. Alternative solution, i've implemented, and will release in next hour, is to check if analyser run on plateform 7.1+ and stop analysis. That will give a console output error such as phpCompatInfo 5.0-dev is unable to parse PHP scripts with version 7.1.12 |
Not true, is able to parse PHP script which requires php < 7.1, which is very different. |
@remicollet Perharps the message is not correct. I prefer to have an error message (warning) that allow user to know why ! |
@remicollet Perharps this message is more correct phpCompatInfo 5.0-dev is unable to parse PHP scripts with syntax PHP 7.1 or greater Your opinion ? |
Correction is available at llaville/php-reflect@6469b1e |
IIUC, current fix proposal make phpcompatinfo unusable. -1 from me
So properly report such parser error, only in this case |
You're right : sprintf syntax was invalid in latest commit : here is the fix llaville/php-reflect@8635309 |
still unusable on PHP 7.1+ |
Please explain in which condition ? Here is my context of text :
phpCompatInfo 5.0-dev is unable to parse PHP scripts with syntax PHP 7.1 or greater |
Please understand me correctly: 1/ I use phpcompatinfo daily with PHP 7.1.12 and 7.2.0: IT WORKS 2/ For this very specific case, it the parser fails it should report it
|
Yes of course i understand. Thanks for your feedback |
New fix will be able to produce errors raised by php-parser Here is a preview with structure analyser
Raw output (verbose level 3) preview
Of course all custom analysers should be revisited to adapt new errors entry (free to do what you want) ! |
Fix is now available with 3 commits :
|
Running on script example, php-compatinfo will output
Feedback are welcome, before to release new versions (of php-reflect and php-compatinfo) |
LGTM |
ok so i'll prepare a new release 4.2.0 for php-reflect and a new release 5.0.10 for php-compatinfo (with reflect constraint raise to 4.2 min) |
New versions are now available ! |
if we use the new list syntax e.g
[$foo,$bar,$baz]
instead oflist($foo,$bar,$baz)
phpcompatinfo bugs out and skip the whole file without notice.The text was updated successfully, but these errors were encountered: