Re: dropping curly braces
| From: | Rasmus Lerdorf | Date: | Fri, 18 Nov 2005 00:05:06 +0000 |
| Subject: | Re: dropping curly braces | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-20116@lists.php.net to get a copy of this message | ||
Robert Cummings wrote:
On Thu, 2005-11-17 at 18:33, Ilia Alshanetsky wrote:Right, that was a mistake which we are fixing now. Removing [] doesn't seem to be a viable option, so rather than continue to tell people to stop using [] since it is never going to go away, the main decision here was to undeprecate []. Whether we will eventually remove {} or not remains to be seen. The initial idea was to try to remove it in PHP6 and in order to help people easily find where these are used, add an E_STRICT for it in PHP 5.1. -RasmusAndreas Korthaus wrote:That should have been considered before everyone was told that [] was deprecated for strings in favour of {}.OK, but by dropping {} for strings you also remove the possibility to have a convention like "[] for arrays and {} for strings". If I could decide I would drop {} for arrays and [] for strings, but I fear I will not be asked to decide... ;-)You may think that {} and [] are different, but in reality same code deals with both. Having two constructs for the same behavior is silly and leads to confusing, hard to read code. Especially so when you consider the fact {} has another meaning that is completely different.