Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27781 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 by uid 1010); 5 Feb 2007 04:21:09 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 6403 invoked from network); 5 Feb 2007 04:21:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Feb 2007 04:21:09 -0000 Authentication-Results: pb1.pair.com header.from=ceo@l-i-e.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=ceo@l-i-e.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain l-i-e.com from 67.139.134.202 cause and error) X-PHP-List-Original-Sender: ceo@l-i-e.com X-Host-Fingerprint: 67.139.134.202 o2.hostbaby.com FreeBSD 4.7-5.2 (or MacOS X 10.2-10.3) (2) Received: from [67.139.134.202] ([67.139.134.202:1206] helo=o2.hostbaby.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D7/EB-18726-4B0B6C54 for ; Sun, 04 Feb 2007 23:21:09 -0500 Received: (qmail 89214 invoked by uid 98); 5 Feb 2007 04:21:12 -0000 Received: from 127.0.0.1 by o2.hostbaby.com (envelope-from , uid 1013) with qmail-scanner-1.25 (clamdscan: 0.88.7/2522. Clear:RC:1(127.0.0.1):. Processed in 0.221536 secs); 05 Feb 2007 04:21:12 -0000 X-Qmail-Scanner-Mail-From: ceo@l-i-e.com via o2.hostbaby.com X-Qmail-Scanner: 1.25 (Clear:RC:1(127.0.0.1):. Processed in 0.221536 secs) Received: from localhost (HELO l-i-e.com) (127.0.0.1) by localhost with SMTP; 5 Feb 2007 04:21:11 -0000 Received: from 67.184.122.32 (SquirrelMail authenticated user ceo@l-i-e.com) by www.l-i-e.com with HTTP; Sun, 4 Feb 2007 22:21:11 -0600 (CST) Message-ID: <1753.67.184.122.32.1170649271.squirrel@www.l-i-e.com> In-Reply-To: <011701c7482d$a39f6910$6500a8c0@zend.2k> References: <011701c7482d$a39f6910$6500a8c0@zend.2k> Date: Sun, 4 Feb 2007 22:21:11 -0600 (CST) To: "Andi Gutmans" Cc: internals@lists.php.net Reply-To: ceo@l-i-e.com User-Agent: Hostbaby Webmail MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Subject: Re: [PHP-DEV] Syntactic improvement to array From: ceo@l-i-e.com ("Richard Lynch") On Sun, February 4, 2007 1:25 am, Andi Gutmans wrote: > I thought I may have brought this up a long time ago but couldn't find > anything in the archives. > For a long time already I've been thinking about possibly adding a new > syntax for array(...) which would be shorter. I'd suggest > [...]. While I am usually not in favor of having more than one way to > do things, I think it'd look much more elegant especially (but > not only) for nested arrays. > > So what I'm thinking of is: > array(1, 2, 3) == [1, 2, 3] > array(1, 2, array("foo", "bar")) == [1, 2, ["foo", "bar"]] > array("key" => 1, "key2" => 2) == ["key" => 1, "key2" => 2] > > $arr = [1, 2, 3] > vs. > $arr = array(1, 2, 3) > > Well enough examples given :) > I think it's not worth doing unless there's overwhelming support as > it's not desperately needed. But I'd be interested to hear > people's thoughts. It seems implementation shouldn't be an issue but > I'd have to dive a bit deeper. I somewhat prefer seeing 'array' there so I know what the [bleep] is going on, personally. -0.3 -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?