What are the potential pitfalls of incorrectly using parentheses instead of square brackets in PHP when accessing array elements?

Using parentheses instead of square brackets in PHP when accessing array elements will result in a syntax error because parentheses are used for function calls, not array element access. To fix this issue, make sure to use square brackets when accessing array elements.

// Incorrect usage of parentheses to access array element
$array = ['apple', 'banana', 'cherry'];
// This will result in a syntax error
// echo $array(1);

// Correct usage of square brackets to access array element
echo $array[1]; // Outputs 'banana'