Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42320 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89793 invoked from network); 18 Dec 2008 01:18:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Dec 2008 01:18:43 -0000 Authentication-Results: pb1.pair.com header.from=jay.27182818@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=jay.27182818@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.21 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: jay.27182818@gmail.com X-Host-Fingerprint: 209.85.218.21 mail-bw0-f21.google.com Received: from [209.85.218.21] ([209.85.218.21:63486] helo=mail-bw0-f21.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1A/60-21696-2F4A9494 for ; Wed, 17 Dec 2008 20:18:43 -0500 Received: by bwz14 with SMTP id 14so585064bwz.23 for ; Wed, 17 Dec 2008 17:18:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=1or1Zb7d4iX4gX7oKapmsEYiadRCs3Tpio6FcZaS2Vs=; b=YUF1P/XVjF3adQ4kiCGc9jLe4ikOX4YivcEQYXZP9Nd27Ikp8D1zmrvcw7DM/VWxSE uZ9KuUebcq/fh4Itoc/VEE3roBimZQuj4rDqbi8pgNvFSE2gzB6XMHpH43J6ZBfuM1Wk qr5nlEGo4gOvfFSRXS218iyCZCVFA0F13nxaU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=PGYHNrwgpa3kWd/zy5pq3yiNGtgRNUS/H71cZm3QQ3eRjtx8tGrzZveZ36Qx0NhzY9 IcpnFsAnIfno/W9JI45Oorfj4uO5H/8bIEEGvr5QOxBa76S9EyDiDRLhicNsaRD8C+qj z/3F0vgKj50FXhZXu3nr6uaDfTeDgwDKmxfYk= Received: by 10.103.250.1 with SMTP id c1mr531067mus.64.1229563119643; Wed, 17 Dec 2008 17:18:39 -0800 (PST) Received: from ?192.168.1.100? (148.101.235.77.dyn.idknet.com [77.235.101.148]) by mx.google.com with ESMTPS id n7sm11023541mue.23.2008.12.17.17.18.38 (version=SSLv3 cipher=RC4-MD5); Wed, 17 Dec 2008 17:18:38 -0800 (PST) To: Jeff Griffiths Cc: internals@lists.php.net In-Reply-To: <49499B34.4000300@activestate.com> References: <1229560181.14598.13.camel@jay> <49499B34.4000300@activestate.com> Content-Type: text/plain Date: Thu, 18 Dec 2008 03:18:36 +0200 Message-ID: <1229563116.6152.16.camel@jay> Mime-Version: 1.0 X-Mailer: Evolution 2.24.2 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] simpler syntax for arrays From: jay.27182818@gmail.com (jay) On Wed, 2008-12-17 at 16:37 -0800, Jeff Griffiths wrote: > On 12/17/08 4:29 PM, jay wrote: > > hi guys. i'm very new to your list so maybe something similar to my > > proposal has been already posted somewhere at this list but really i > > don't know how i can make the search. > > i often pass arrays to functions/methods this way: > > > > myfunc(array('key1'=>'val1', 'key2'=>'val2', ...)); > > > > it's really annoying to type in 'array' every time. i suggest using a > > simpler syntax: > > > > myfunc(['key1'=>'val1', 'key2'=>'val2', ...]); > > > > like in javascript. it'd be very nice to have this handy feature. > > This has been discussed as a potential feature for 5.3, but was > discussed after no small amount of flames and acrimony. here is the > relevant wiki page: > > http://wiki.php.net/rfc/shortsyntaxforarrays > > cheers, Jeff okey. another syntax: myfunc($('key1'=>'val1', 'key2'=>'val2', ...)); this can be implemented just as a shortcut for the array keyword. i think it won't be very hard to extend syntax for the dollar sign. my idea is to shorten the syntax. no matter how it will be achieved. regards, jay