-
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
Keywords reserved cannot be detected with PHP 5.3 platform #4
Comments
You may be perharps interested by the presentation I wrote llaville/php-compatinfo#202 (comment) to explain how I solved this issue on my project. |
Your comments evokes my memory of developing this project... I remember I have 3 solutions about the same problem how to handle reserved keywords ?
After discussion, conclusion is that users want to check incompatible things and make sure his code runing on new version of PHP. So the second solution meets requirement, It'll emit a Syntax error if a reserved keyword appeared in wrong place, and all new features will be checked. And the most important is, that's just simple, and do all we needs. |
Don't forget to have a look on my new version of Emulative Lexer ( llaville/php-reflect@c828107) that solved the problem |
@monque Did you have time to have a look on my new Emulative lexer copy (see previous comment). Since then, I've begun to write lot of sniffs and especially the KeyWordReservedSniff that checks for keywords uses. It works fine for me on all PHP versions |
@monque Be sure to pick the latest php-reflect version on sniffer branch. See last commit llaville/php-reflect@4be20c3 that fixed (I hope) the last detection issue |
@llaville This file KeyWordReservedSniff makes a perfect solution. Thanks for your contribution, I'm too busy to develop new feature..., so sorry for this. Will you add all these "sniffs" for version compatibility to |
@monque For next version 4.4.0 of php-compatinfo the |
I'll closed this issue, because php-compatinfo 4.5.x is the last version that will support PHP 5.3 and my version of Emulative Lexer to detect keywords. |
When your run on a PHP 5.3 plaform to detect if keywords reserved are used. E.g
With source file (keywords_reserved.php)
You got following error
Reason is that PHP-Parser is not yet able to catch such condition, until now. I've proposed an improvement nikic/PHP-Parser#202
And soon, I'll propose a migration analyser on my php-compatinfo project, based on Sniff pattern.
See llaville/php-compatinfo#202
I must gave you a credit, because this future analyser (that is available to detect even keywords reserved) is due to a deeper analysis of your project architecture.
The text was updated successfully, but these errors were encountered: