I always use the parentheses to define an array in PHP, such as:
$array = array('a','b','c');
But every now and then I see some code here using brackets, like:
$array = ['a', 'b', 'c'];
However, if I use brackets, I get the error:
Parse error: syntax error, unexpected '[' in ...
What is the correct way? Does it have anything to do with the PHP version? Which version accepts one thing and another?
echo phpversion(); in a PHP page of my hosting I get the following version: