Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27813 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88692 invoked by uid 1010); 5 Feb 2007 18:02:17 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 88676 invoked from network); 5 Feb 2007 18:02:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Feb 2007 18:02:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=andrei@gravitonic.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=andrei@gravitonic.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain gravitonic.com from 204.11.219.139 cause and error) X-PHP-List-Original-Sender: andrei@gravitonic.com X-Host-Fingerprint: 204.11.219.139 lerdorf.com Linux 2.5 (sometimes 2.4) (4) Received: from [204.11.219.139] ([204.11.219.139:34972] helo=lerdorf.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6C/72-61367-82177C54 for ; Mon, 05 Feb 2007 13:02:17 -0500 Received: from [66.228.175.145] (borndress-lm.corp.yahoo.com [66.228.175.145]) (authenticated bits=0) by lerdorf.com (8.13.8/8.13.8/Debian-3) with ESMTP id l15I2EJo001601; Mon, 5 Feb 2007 10:02:14 -0800 In-Reply-To: <7.0.1.0.2.20070204185805.08ae9ed0@zend.com> References: <011701c7482d$a39f6910$6500a8c0@zend.2k> <7.0.1.0.2.20070204185805.08ae9ed0@zend.com> Mime-Version: 1.0 (Apple Message framework v624) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-ID: Content-Transfer-Encoding: 7bit Cc: "Andi Gutmans" , Date: Mon, 5 Feb 2007 10:03:18 -0800 To: Zeev Suraski X-Mailer: Apple Mail (2.624) X-Virus-Scanned: ClamAV 0.90rc3/2525/Mon Feb 5 08:11:08 2007 on colo X-Virus-Status: Clean Subject: Re: [PHP-DEV] Syntactic improvement to array From: andrei@gravitonic.com (Andrei Zmievski) I agree. Syntax is good, if we make it work both ways. -Andrei On Feb 4, 2007, at 8:59 AM, Zeev Suraski wrote: > 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 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php