I have a question about PHP syntax.
When defining functions and variables, which convention should I use?
I know they do the same thing in practice but I wou
from PHP docs:
As of PHP 5.4 you can also use the short array syntax, which replaces array() with [].
"bar",
"bar" => "foo",
);
// as of PHP 5.4
$array = [
"foo" => "bar",
"bar" => "foo",
];
?>
if you'd try using '[]' notation in earlier version than 5.4, it will fail, and PHP will throw a syntax error
for backward-compatibility you should use array() syntax.