PHP VERSION: 8.2.18

uniform_variable_syntax_dereferencing_strings.php

<?php

function getStr()
{
    return 
'ABCDEF';
}

echo 
getStr()[4];
echo 
PHP_EOL;

// generates error in php 5.x
echo getStr(){4};

Output