From b6c58710c83e40b3183c705dc01cc8c6a7418843 Mon Sep 17 00:00:00 2001 From: LogMANOriginal Date: Fri, 1 Nov 2019 18:03:53 +0100 Subject: [PATCH] Created Arrays (markdown) --- Arrays.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Arrays.md 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