Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27748 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98880 invoked by uid 1010); 4 Feb 2007 16:59:12 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 98865 invoked from network); 4 Feb 2007 16:59:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Feb 2007 16:59:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=zeev@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=zeev@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: zeev@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from [212.25.124.162] ([212.25.124.162:14092] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3E/E1-18726-ED016C54 for ; Sun, 04 Feb 2007 11:59:12 -0500 Received: (qmail 23932 invoked from network); 4 Feb 2007 16:57:30 -0000 Received: from localhost (HELO lap-zeev.zend.com) (127.0.0.1) by localhost with SMTP; 4 Feb 2007 16:57:30 -0000 Message-ID: <7.0.1.0.2.20070204185805.08ae9ed0@zend.com> X-Mailer: QUALCOMM Windows Eudora Version 7.0.1.0 Date: Sun, 04 Feb 2007 18:59:07 +0200 To: "Andi Gutmans" Cc: 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"; format=flowed Subject: Re: [PHP-DEV] Syntactic improvement to array From: zeev@zend.com (Zeev Suraski) My 2c - unless we also make it behave like a list() when in assignment context - I think it will confusing. So I'm +1 if we make it work as both list() and array(), and -1 otherwise. Zeev At 09:25 04-02-07, 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 > >-- >PHP Internals - PHP Runtime Development Mailing List >To unsubscribe, visit: http://www.php.net/unsub.php