Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42317 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78607 invoked from network); 18 Dec 2008 00:37:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Dec 2008 00:37:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=jeffg@activestate.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=jeffg@activestate.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain activestate.com designates 204.244.102.3 as permitted sender) X-PHP-List-Original-Sender: jeffg@activestate.com X-Host-Fingerprint: 204.244.102.3 mx.activestate.com Linux 2.6 Received: from [204.244.102.3] ([204.244.102.3:36184] helo=mx.activestate.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E2/A5-48223-63B99494 for ; Wed, 17 Dec 2008 19:37:11 -0500 Received: from box5.activestate.com (box25.activestate.com [192.168.69.70]) by mx.activestate.com (Postfix) with ESMTP id 2151014002; Wed, 17 Dec 2008 16:37:08 -0800 (PST) Received: from opus.activestate.com (opus.activestate.com [192.168.69.200]) by box5.activestate.com (Postfix) with ESMTP id 1B194B8347; Wed, 17 Dec 2008 16:37:08 -0800 (PST) Message-ID: <49499B34.4000300@activestate.com> Date: Wed, 17 Dec 2008 16:37:08 -0800 User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3pre) Gecko/20081215 Shredder/3.0b2pre MIME-Version: 1.0 To: jay CC: internals@lists.php.net References: <1229560181.14598.13.camel@jay> In-Reply-To: <1229560181.14598.13.camel@jay> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] simpler syntax for arrays From: jeffg@activestate.com (Jeff Griffiths) 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