diff --git a/Arrays.md b/Arrays.md new file mode 100644 index 0000000..882ff55 --- /dev/null +++ b/Arrays.md @@ -0,0 +1,21 @@ +# Always use the long array syntax + +Arrays should be initialized using the long array syntax. + +
Example

+ +**Bad** + +```PHP +$data = [ 'hello' => 'world' ]; +``` + +**Good** + +```PHP +$data = array('hello' => 'world'); +``` + +

+ +_Reference_: [`Generic.Arrays.DisallowShortArraySyntax`](https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/Generic/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php) \ No newline at end of file