Skip to content

SECURITY: clarify status of parse errors - #58

Open
jrfnl wants to merge 1 commit into
mainfrom
feature/security-exclude-parse-errors
Open

jrfnl wants to merge 1 commit into
mainfrom
feature/security-exclude-parse-errors

Conversation

@jrfnl

@jrfnl jrfnl commented Nov 1, 2026

Copy link
Copy Markdown
Member

PHP_CodeSniffer is intended to scan valid PHP code. PHP_CodeSniffer attempts to be parse error tolerant, especially with an eye on its usage within IDE environments.

Something which may be a parse error on one PHP version, may not be a parse error in another PHP version. PHP_CodeSniffer will handle those situations, generally caused by the introduction of new PHP syntaxes, in the Tokenizer layer.

However, that's where the responsibility of PHP_CodeSniffer ends, as defending against every possible parse error a user can introduce is neigh impossible and scanning code containing parse errors is not a valid usecase for PHP_CodeSniffer.

PHP_CodeSniffer is intended to scan valid PHP code. PHP_CodeSniffer attempts to be parse error tolerant, especially with an eye on its usage within IDE environments.

Something which may be a parse error on one PHP version, may not be a parse error in another PHP version. PHP_CodeSniffer will handle those situations, generally caused by the introduction of new PHP syntaxes, in the Tokenizer layer.

However, that's where the responsibility of PHP_CodeSniffer ends, as defending against every possible parse error a user can introduce is neigh impossible and scanning code containing parse errors is not a valid usecase for PHP_CodeSniffer.
@jrfnl

jrfnl commented Nov 1, 2026

Copy link
Copy Markdown
Member Author

@edorian @fredden @rodrigoprimo If you have the time, I'd appreciate feedback for this PR.

@jrfnl jrfnl added this to the 1.3.x Next milestone Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants