
list_syntax
¶List (array
destructuring) assignment should be declared using the
configured syntax. Requires PHP >= 7.1.
syntax
¶Whether to use the long
or short
list
syntax.
Allowed values: 'long'
, 'short'
Default value: 'short'
Default configuration.
--- Original
+++ New
<?php
-list($sample) = $array;
+[$sample] = $array;
With configuration: ['syntax' => 'long']
.
--- Original
+++ New
<?php
-[$sample] = $array;
+list($sample) = $array;
The rule is part of the following rule sets:
Using the @PHP71Migration rule set will enable the list_syntax
rule with the default config.
Using the @PHP73Migration rule set will enable the list_syntax
rule with the default config.
Using the @PHP74Migration rule set will enable the list_syntax
rule with the default config.
Using the @PHP80Migration rule set will enable the list_syntax
rule with the default config.
Using the @PHP81Migration rule set will enable the list_syntax
rule with the default config.
Using the @PHP82Migration rule set will enable the list_syntax
rule with the default config.