Reasons to deprecate curly braces syntax::
1.      Two ways to do the same thing.
2.      It is very rarely used nowadays.
3.      It is almost not documented. There is only two short “NOTE” about 
it.
4.      Also, this syntax has reduced functionality. You can't use it for 
pushing element into array “$arr{} = 1;”, creating array “$a={1,2};” or in 
other similar cases.
5.      Deprecation and following removal will free this syntax for other 
features. For example: array/string slice, absolute offset access, 
“windows” (like “slice” in GoLang), etc.

Proposal
https://wiki.php.net/rfc/deprecate_curly_braces_array_access

Patch diff
https://github.com/php/php-src/compare/PHP-7.4...rjhdby:deprecate_alternate_array_access

Migration script
https://github.com/rjhdby/php-src/blob/deprecate_alternate_array_access/convert_array_access_braces.php

Reply via email to