In the PHP manual, we can see the New Features functionality of Array and String literal Dereferencing .
Example:
echo 'string'[2]; // r
echo ['stack', 'overflow'][1]; //overflow
Thinking about whether to get a index from a string or array , would already work on other versions of PHP, since Array or the string were in a variable.
$var = 'string';
echo $var[2]; // 'r'
In PHP 5.4, I know that we now have direct access to the members of an array that are returned by a function, and that is very useful per sign ( Function array dereferencing ).
But in the case of PHP 5.5, I do not understand what is the purpose of getting a value through an index directly from a string or an array since they are not allocated to a variable?
For me, it would not make sense for the programmer to use the first example above.
Is there a more robust purpose than the first example?