On 15/03/2019 14:39, Andrey O Gromov wrote:
> 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
Do I understand it right, that you're proposing deprecating accessing
$string{$offset}? I think that's an important way of differentiation
between string and array offset access.
I'd vote "yes" for splitting syntax on array and string offset access,
but as is: -1.
>
> 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
>
--
Regards,
Mike
signature.asc
Description: OpenPGP digital signature
