Skip to content

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