Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27732 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50742 invoked by uid 1010); 4 Feb 2007 10:12:20 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 50727 invoked from network); 4 Feb 2007 10:12:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Feb 2007 10:12:19 -0000 Authentication-Results: pb1.pair.com header.from=helly@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=helly@php.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain php.net from 85.214.94.56 cause and error) X-PHP-List-Original-Sender: helly@php.net X-Host-Fingerprint: 85.214.94.56 h1149922.serverkompetenz.net Linux 2.6 Received: from [85.214.94.56] ([85.214.94.56:54150] helo=h1149922.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2D/3A-54400-381B5C54 for ; Sun, 04 Feb 2007 05:12:19 -0500 Received: from baumbart.mbo (dslb-084-063-003-075.pools.arcor-ip.net [84.63.3.75]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by h1149922.serverkompetenz.net (Postfix) with ESMTP id 2CB5E1B34A3; Sun, 4 Feb 2007 10:58:25 +0100 (CET) Date: Sun, 4 Feb 2007 11:10:13 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1479182813.20070204111013@marcus-boerger.de> To: Andi Gutmans CC: internals@lists.php.net In-Reply-To: <011701c7482d$a39f6910$6500a8c0@zend.2k> References: <011701c7482d$a39f6910$6500a8c0@zend.2k> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Syntactic improvement to array From: helly@php.net (Marcus Boerger) Hello Andi, it is a bit harder to read and not the php way imo. best regards marcus Sunday, February 4, 2007, 8:25:22 AM, you 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 Best regards, Marcus