Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27761 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37432 invoked by uid 1010); 4 Feb 2007 18:56:51 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 37417 invoked from network); 4 Feb 2007 18:56:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Feb 2007 18:56:51 -0000 Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain php.net from 82.94.239.5 cause and error) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.94.239.5 jdi.jdi-ict.nl Received: from [82.94.239.5] ([82.94.239.5:57924] helo=jdi.jdi-ict.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3E/27-18726-27C26C54 for ; Sun, 04 Feb 2007 13:56:51 -0500 Received: from localhost (localhost [127.0.0.1]) by jdi.jdi-ict.nl (8.13.7/8.12.11) with ESMTP id l14Iulsx029833; Sun, 4 Feb 2007 19:56:47 +0100 Date: Sun, 4 Feb 2007 19:56:25 +0100 (CET) X-X-Sender: derick@localhost To: Andi Gutmans cc: PHP Developers Mailing List In-Reply-To: <011701c7482d$a39f6910$6500a8c0@zend.2k> Message-ID: References: <011701c7482d$a39f6910$6500a8c0@zend.2k> X-Face: "L'&?Ah3MYF@FB4hU'XhNhLB]222(Lbr2Y@F:GE[OO;"F5p>qtFBl|yVVA&D{A(g3[C}mG:199P+5C'v.M/u@Z\![0b:Mv.[l6[uWl' MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] Syntactic improvement to array From: derick@php.net (Derick Rethans) On Sat, 3 Feb 2007, 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. That gets a big -1 from me, unless you misposed this mail and it should have ended up on internals@perl.org or something ;-) regards, Derick