The “square bracket designation” for array elements will be more unified and acceptable.
The "brace insert" will work in expressions, but not in the interpolation variable when accessing an array element. example:
$myArray = [1,2]; $index = 1; echo "value at index $index is $myArray[$index]"; // outputs "value at index 1 is 2" echo "value at index $index is $myArray{$index}"; // will throw "Notice: Array to string conversion" var_dump($myArray{$index}); // outputs "int(2)"
source share