Proposal for deprecate alternate syntax(curly braces) for array and string access

From: Date: Fri, 15 Mar 2019 13:39:13 +0000
Subject: Proposal for deprecate alternate syntax(curly braces) for array and string access
Groups: php.internals 
Request: Send a blank email to internals+get-104744@lists.php.net to get a copy of this message
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

« previous php.internals (#104744) next »