Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20139 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24645 invoked by uid 1010); 18 Nov 2005 11:36:17 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 24629 invoked from network); 18 Nov 2005 11:36:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Nov 2005 11:36:16 -0000 X-Host-Fingerprint: 80.137.61.38 p50893D26.dip0.t-ipconnect.de Received: from ([80.137.61.38:9694] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id D7/CA-07637-0BCBD734 for ; Fri, 18 Nov 2005 06:36:16 -0500 To: internals@lists.php.net,Derick Rethans Message-ID: <437DBCAB.3060009@web.de> Date: Fri, 18 Nov 2005 12:36:11 +0100 User-Agent: Thunderbird 1.5 (Windows/20051025) MIME-Version: 1.0 CC: Rasmus Lerdorf , Ilia Alshanetsky References: <437B530A.5050105@prohost.org> <437CF6B4.5080207@web.de> <437CF943.7090800@lerdorf.com> <437D0D08.8060805@web.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 80.137.61.38 Subject: Re: [PHP-DEV] dropping curly braces From: akorthaus@web.de (Andreas Korthaus) Derick Rethans wrote: >> That's the problem - also grep does not know if [] is used for arrays or >> stings. That's the same for programmers, it's often not easy to conclude from >> context - that's my point. > > grep won't, but php -l will. That's true. But what about "reducing complexity"? Don't you think it's useful to allow a convention like {} for strings and [] for arrays, so you can be sure what $str{1} means without looking at any context? As Rasmus explained, this can't be enforced, but you still can use a convention in your projects today. I think it's good to increase readability using conventions like that. I'd not drop anything or break any BC, I'd keep this option because having such a convention is very useful when debugging/reading complex scripts. I know that it's not much work to replace {} with [] syntax, but this will decrease readability - that's my only problem. best regards Andreas