Skip to content
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

Error generated during tokenizing of goto statements on PHP 8 #3033

Merged

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Jul 23, 2020

PHP 8.0 elevates a number of notices/warnings to errors, which now exposes a bug in the goto tokenizer logic.

Error: Trying to access array offset on value of type null

Fixed by making sure that the token being accessed is an array before trying to access it.

Discovered via a failing unit test in WordPressCS.

PHP 8.0 elevate a number of notices/warnings to errors, which now exposes a bug in the `goto` tokenizer logic.

Error: `Trying to access array offset on value of type null`

Fixed by making sure that the token being accessed is an array before trying to access it.
@gsherwood gsherwood added this to the 3.5.6 milestone Jul 23, 2020
@gsherwood gsherwood changed the title PHP 8.0 | Tokenizer/PHP: bug fix Error generated during tokenizing of goto statements on PHP 8 Aug 10, 2020
gsherwood added a commit that referenced this pull request Aug 10, 2020
@gsherwood gsherwood merged commit 14788ab into squizlabs:master Aug 10, 2020
@gsherwood
Copy link
Member

Thanks for this fix

@jrfnl jrfnl deleted the feature/php-8-fix-array-access-on-type-null branch August 10, 2020 01:00
@jrfnl
Copy link
Contributor Author

jrfnl commented Aug 10, 2020

You're welcome.

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.

2 participants