Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27736 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92444 invoked by uid 1010); 4 Feb 2007 13:18:08 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 92422 invoked from network); 4 Feb 2007 13:18:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Feb 2007 13:18:08 -0000 Authentication-Results: pb1.pair.com header.from=johannes@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@php.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain php.net from 88.217.2.121 cause and error) X-PHP-List-Original-Sender: johannes@php.net X-Host-Fingerprint: 88.217.2.121 ppp-88-217-2-121.dynamic.mnet-online.de Received: from [88.217.2.121] ([88.217.2.121:50406] helo=johannes.nop) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4F/BE-54400-F0DD5C54 for ; Sun, 04 Feb 2007 08:18:08 -0500 Received: from johannes.nop (localhost [127.0.0.1]) by johannes.nop (8.13.8/8.13.8) with ESMTP id l14DI6In004764; Sun, 4 Feb 2007 14:18:06 +0100 Received: (from johannes@localhost) by johannes.nop (8.13.8/8.13.8/Submit) id l14DI5OP004763; Sun, 4 Feb 2007 14:18:05 +0100 X-Authentication-Warning: johannes.nop: johannes set sender to johannes@php.net using -f To: Andi Gutmans Cc: internals@lists.php.net In-Reply-To: <011701c7482d$a39f6910$6500a8c0@zend.2k> References: <011701c7482d$a39f6910$6500a8c0@zend.2k> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Sun, 04 Feb 2007 14:18:05 +0100 Message-ID: <1170595085.6832.468.camel@johannes.nop> Mime-Version: 1.0 X-Mailer: Evolution 2.8.2.1 (2.8.2.1-3.fc6) Subject: Re: [PHP-DEV] Syntactic improvement to array From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) Hi Andi, I'd like such a syntax enhancement. These should be the results from the last time the issue was discussed: http://devzone.zend.com/node/view/id/1474#Heading7 If I remember correct the main issues stated against it were - it's to perlish - Without keyword it's hard to find the documentation if you don't know that syntax But I would still like having it :-) johannes On Sat, 2007-02-03 at 23:25 -0800, Andi Gutmans wrote: > Hi, > > 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. > > Andi >