Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37961 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6418 invoked from network); 28 May 2008 11:27:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 May 2008 11:27:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=felipensp@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=felipensp@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.146.183 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: felipensp@gmail.com X-Host-Fingerprint: 209.85.146.183 wa-out-1112.google.com Received: from [209.85.146.183] ([209.85.146.183:46564] helo=wa-out-1112.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 79/0F-15519-4A14D384 for ; Wed, 28 May 2008 07:27:33 -0400 Received: by wa-out-1112.google.com with SMTP id v27so3189274wah.17 for ; Wed, 28 May 2008 04:27:30 -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=+6xDrJLkvp67FQrv2gZB7oh0ajB9BOn8UfBpCGYL5tA=; b=iAZzUTx6HvvMnjIKgAzzEhF6gxkvbweQTZzqpbdDNwWPlarfFn9Mwj3Ld+17Jo0aGuKUbzOE8BzW6vlSS2MV/lHcnS75lfspWMsQKrZuBz+4iS45mA1lBWt1WMGoV1fRCWvmvtoj/tuP5H97kP2YmWBZ4uaIzF8ccimadRCfHZk= 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=RmQBViRhs20C5+f3gIIWoBUbxQ2aNvameIl0qWnpbSXDVN6GMHGAVPAhCJnk0jDnjw2qv2NUhEkeVnNtH2l8/RF7FhvR/cUQHLyzYAs1sU5D4xDhFxbbArAH+TGT/w/GEtFP8k+s9H2rc5iZrPNbwd8hzhduLhEzIcCcjDV8vig= Received: by 10.114.111.1 with SMTP id j1mr2381391wac.27.1211974050043; Wed, 28 May 2008 04:27:30 -0700 (PDT) Received: by 10.115.33.4 with HTTP; Wed, 28 May 2008 04:27:29 -0700 (PDT) Message-ID: <46ccd1ab0805280427p3d9ec085t4643f029b13a4eb8@mail.gmail.com> Date: Wed, 28 May 2008 08:27:29 -0300 To: "Sebastian Deutsch" Cc: internals@lists.php.net In-Reply-To: <97.F8.15519.1229C384@pb1.pair.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <0412F6FE505049F7901EAB8C61774839@pc> <87.77.15519.9E47C384@pb1.pair.com> <97.F8.15519.1229C384@pb1.pair.com> Subject: Re: [PHP-DEV] Re: Short syntax for array literals [...] From: felipensp@gmail.com ("Felipe Pena") 2008/5/27, Sebastian Deutsch : > fyi - i added a RFC > > http://wiki.php.net/rfc/shortsyntaxforarrays > > please add your votes > I'm -1. > cheers > > Sebastian > > Sebastian Deutsch schrieb: > > > > dont have karma - but I would love it! so +1 here. > > would it make sense to write an RFC? > > > > cheers > > > > Sebastian > > > > Stan Vassilev | FM schrieb: > > > > > Hi, > > > > > > I hear this often by other developers and I tend to agree with them, > that arrays are used often, and often nested, so that having a long syntax > for array literals tend to produce less legible code than in other scriping > languages. > > > > > > $a = array(array(1,2), array(3,4), 5, 6); > > > > > > $b = array('a' => 1, 'b' =>2); > > > > > > We use arrays in our configurations, in passing complex parameters to > functions, fetching information from databases, basically everything. So it > adds up. > > > > > > Some frameworks have somewhat funny attempts to remedy this by > introducing "shortcuts" like this: function a() { return func_get-args(); > }. Of course this doesn't work when you need to specify the key name, and > the overhead isn't worth it. > > > > > > It looks as there may not be a specific reason not to allow the JS > syntax as an alternative syntax (while keeping the current one in parallel): > > > > > > $a = [[1, 2], [3, 4], 5, 6]; > > > > > > $b = ['a' => 1, 'b' =>2]; > > > > > > There shouldn't be confusion to the parser as the brackets aren't > preceded by an identifier. > > > > > > Was this discussed before on the list? > > > > > > Regards, Stan Vassilev > > > > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Felipe Pena.