What are potential pitfalls of using double brackets for indexing arrays in PHP?

Using double brackets for indexing arrays in PHP can lead to unexpected behavior and errors, as double brackets are not a valid syntax for array indexing in PHP. To correctly access elements in an array, single brackets should be used instead.

// Incorrect usage of double brackets for array indexing
$array = [[1, 2], [3, 4]];
echo $array[[0][1]]; // This will result in an error

// Correct usage of single brackets for array indexing
$array = [[1, 2], [3, 4]];
echo $array[0][1]; // This will correctly output 2