Commit 1a26845
committed
PHP 8.5 | Tokenizer/PHP: fix "Using null as an array offset" deprecation
If a comment is on its own line, the new line token is merged into the comment token, and the new line is skipped by setting it to `null`.
Where the next line contains incomplete, or invalid, code which ends in an nullsafe operator (for example `$obj?`), the tokenizer will step backwards until it finds the next non-empty line.
The skipped new line token should be skipped during this parsing.
This can only occur during live coding or when a file has a parse error, but PHPCS should handle that situation gracefully.
Fixed now.
Fixes #1216.
This change is already covered via the existing tests.
Ref: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_using_values_null_as_an_array_offset_and_when_calling_array_key_exists1 parent 379692d commit 1a26845
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2255 | 2255 | | |
2256 | 2256 | | |
2257 | 2257 | | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
2258 | 2261 | | |
2259 | 2262 | | |
2260 | 2263 | | |
| |||
0 commit comments