EDIT This topic might interest you: "removing curly braces"
This is just an alternative syntax; two forms are compiled to the exact same bytecode:
<?php $str = "aaab"; echo $str{3}; echo $str[3];
number of ops: 9
compiled vars:! 0 = $ str
line # * op fetch ext return operands
-------------------------------------------------- -------------------------------
2 0> EXT_STMT
1 ASSIGN! 0, 'aaab'
3 2 EXT_STMT
3 FETCH_DIM_R $ 1! 0, 3
4 ECHO $ ββ1
4 5 EXT_STMT
6 FETCH_DIM_R $ 2! 0, 3
7 ECHO $ ββ2
8> RETURN 1
Artefacto
source share