Array With Curly Braces

Curly braces used to be a feature, used to access specific index in an array or in a string. They acted like the square braces.

This features was deprecated in version 8.0.

<?php

    $array = ['a', 'b', 'c', 'd'];
    echo $array{2};    // c

    $string = 'abcd';
    echo $string{2};   // c

?>

Documentation

See also PHP RFC: Deprecate curly brace syntax for accessing array elements and string offsets.

Related : Array, Bracket

Removed in PHP