1.2.512. Group Use Trailing Comma¶
The usage of a final empty slot in array() was allowed with use statements. This works in PHP 7.2 and more recent.
Although this empty instruction is ignored at execution, this allows for clean presentation of code, and short diff when committing in a VCS.
<?php
// Valid in PHP 7.2 and more recent.
use a\b\{c,
d,
e,
f,
};
// This won't compile in 7.1 and older.
?>
See also Trailing Commas In List Syntax and Revisit trailing commas in function arguments.
1.2.512.1. Connex PHP features¶
1.2.512.1.1. Specs¶
Short name |
Php/GroupUseTrailingComma |
Rulesets |
All, Changed Behavior, CompatibilityPHP53, CompatibilityPHP54, CompatibilityPHP55, CompatibilityPHP56, CompatibilityPHP70, CompatibilityPHP71 |
Exakat since |
0.12.3 |
PHP Version |
With PHP 7.2 and more recent |
Severity |
Major |
Time To Fix |
Instant (5 mins) |
Precision |
Very high |
Available in |