Skip to content

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Sep 9, 2025

Description

Follow up on #1225

This fixes yet another "Using null as an array offset" deprecation notice on PHP 8.5. This one only occurred on PHPCS 4.0, not on 3.x.

The tests for this fix have been pulled in #1225 (to safeguard that the issue doesn't exist in 3.x) and merged up into the 4.x branch.

Note: as the if condition was pretty complex, I've done a small refactor to make the code more readable and understandable.

Suggested changelog entry

Fixed PHP 8.5 "Using null as an array offset" deprecation notice.

Related issues/external references

Loosely related to #1215 and #1216, but yet another instance of this.

This fixes yet another "Using null as an array offset" deprecation notice on PHP 8.5. This one only occurred on PHPCS 4.0, not on 3.x.

The tests for this fix have been pulled in 1225 (to safeguard that the issue doesn't exist in 3.x) and merged up into the 4.x branch.

Note: as the `if` condition was pretty complex, I've done a small refactor to make the code more readable and understandable.
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.

1 participant