False positive with array destructor

Created on 18 April 2021, about 3 years ago
Updated 30 April 2023, about 1 year ago

When using the modern form:

[$first_part,] = explode(':' $string, 2);

instead of:

list($first_part,) = explode(':' $string, 2);

I'm getting 2 violations:

Comma not allowed after last value in single-line array declaration.

and

Expected one space after the comma, 0 found

πŸ’¬ Support request
Status

Fixed

Version

3.0

Component

Coder Sniffer

Created by

πŸ‡·πŸ‡΄Romania claudiu.cristea Arad πŸ‡·πŸ‡΄

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024