Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37947 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59179 invoked from network); 28 May 2008 07:24:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 May 2008 07:24:51 -0000 Authentication-Results: pb1.pair.com smtp.mail=indeyets@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=indeyets@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.46.30 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: indeyets@gmail.com X-Host-Fingerprint: 74.125.46.30 yw-out-2324.google.com Received: from [74.125.46.30] ([74.125.46.30:27045] helo=yw-out-2324.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 17/C6-15519-2C80D384 for ; Wed, 28 May 2008 03:24:50 -0400 Received: by yw-out-2324.google.com with SMTP id 5so1551940ywb.83 for ; Wed, 28 May 2008 00:24:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=MU3yRNU36pQ1BysZKPtX3DwCJX5mjqiG+nx/m97bXUk=; b=g89d2ee/MXp/u3XfCGVM569NevwBxiKxPftaQ1XlPab282zrxS9M51cc4OmXJN9iDecrQmdQStGXdH5fsHWwV4YVyzPI2N5E1kPyxiWWGzXj5Mz5AFco8KCSva2e2s2/IOfxO8ZSyVcSfwLI5yy3tHOCHxf01NkNtPr0NIGBAe4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=uNySCDeCVKTDdd9HVRd7BWQmz8mfMq9phHERk/BS8pdH7uhFnNYDEO7q0YpRAgLqXzt3Xu1ilDydtOomSMdt4xfZtTUNFxU/eW+zguAnQaLaN3rGU/Nu8nqsqnnMcf/faifuxL+6Bz9BoxfRGnLUOuuMjFBvOaTXdC/FcIPTl64= Received: by 10.150.199.21 with SMTP id w21mr3302977ybf.58.1211959487965; Wed, 28 May 2008 00:24:47 -0700 (PDT) Received: by 10.150.158.8 with HTTP; Wed, 28 May 2008 00:24:47 -0700 (PDT) Message-ID: Date: Wed, 28 May 2008 11:24:47 +0400 To: "Antony Dovgal" Cc: "Rasmus Lerdorf" , internals@lists.php.net In-Reply-To: <483D05B6.30804@daylessday.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <0412F6FE505049F7901EAB8C61774839@pc> <87.77.15519.9E47C384@pb1.pair.com> <97.F8.15519.1229C384@pb1.pair.com> <483CF9E9.2010803@daylessday.org> <483CFAE0.203@zend.com> <483CFBAB.8030400@daylessday.org> <483CFF33.6060302@lerdorf.com> <483D05B6.30804@daylessday.org> Subject: Re: [PHP-DEV] Re: Short syntax for array literals [...] From: indeyets@gmail.com ("Alexey Zakhlestin") On 5/28/08, Antony Dovgal wrote: > On 28.05.2008 10:44, Rasmus Lerdorf wrote: > > > Today's web developer is typically writing half their app in some variety > of Ecmascript, either Javascript or Actionscript and this array syntax is > second nature to all those folks. > > > > I don't recall any languages to introduce new syntax because it's so handy > to those who come from PHP and I see no reasons for us to do it either. > I perfectly understand that we (well, you) did it many times in the > beginning, but I believe that time is now gone. > > The array syntax we have exists for many years and is used in gazillions > lines of code, > it's known to every developer who have ever seen a PHP script. > In the same time, the [] syntax will definitely confuse people (wth? this > surely looks like invalid syntax!) and will only help to those how don't > know PHP, but have a certain experience with *script languages, i.e. you're > going to do a favor for 1% and confuse the remaining 99%. percentage is way different. such "short array syntax" is a common ground for a lot of modern dynamic languages. and common ground is nice (it makes life easier not only to people who come to php from other languages, but also to people who would come to other languages, like javascript, after php) > And at last, but not least I don't see anything "more readable and > maintainable" in using square brackets to initialize arrays when the same > brackets are used to access them: > > $a = [$a[1][2], 3]; /* wth does this mean? */ initialize variable $a as array, with elements: 0) value-of-key "2" of array located at key "1" of old array $a 1) 3 difficult to "spell", but easy to understand -- Alexey Zakhlestin http://blog.milkfarmsoft.com/