Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27802 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62320 invoked by uid 1010); 5 Feb 2007 11:19:20 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 62305 invoked from network); 5 Feb 2007 11:19:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Feb 2007 11:19:20 -0000 Authentication-Results: pb1.pair.com header.from=M.Ford@leedsmet.ac.uk; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=M.Ford@leedsmet.ac.uk; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain leedsmet.ac.uk designates 160.9.128.16 as permitted sender) X-PHP-List-Original-Sender: M.Ford@leedsmet.ac.uk X-Host-Fingerprint: 160.9.128.16 mrelay-a.lmu.ac.uk Linux 2.4/2.6 Received: from [160.9.128.16] ([160.9.128.16:28192] helo=mrelay-a.lmu.ac.uk) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 42/04-18726-7B217C54 for ; Mon, 05 Feb 2007 06:19:20 -0500 Received: from localhost.lmu.ac.uk ([127.0.0.1] helo=localhost) by mrelay-a.lmu.ac.uk with esmtp (Exim 4.43) id 1HE1rT-0004Ps-Ri; Mon, 05 Feb 2007 11:18:16 +0000 Received: from mrelay-a.lmu.ac.uk ([127.0.0.1]) by localhost (mrelay-a [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 16720-01; Mon, 5 Feb 2007 11:18:12 +0000 (GMT) Received: from leedsmet-exch1.leedsmet.ac.uk ([160.9.35.117]) by mrelay-a.lmu.ac.uk with esmtp (Exim 4.43) id 1HE1ql-0004OB-Iw; Mon, 05 Feb 2007 11:17:31 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Mon, 5 Feb 2007 11:18:32 -0000 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PHP-DEV] Syntactic improvement to array thread-index: AcdILZ/LgWY/cYJ1QqaG1Uhj1j57+wA6Re4w To: "Andi Gutmans" , X-Virus-Scanned: by McAfee at Leeds Metropolitan University Subject: RE: [PHP-DEV] Syntactic improvement to array From: M.Ford@leedsmet.ac.uk ("Ford, Mike") On 04 February 2007 07:25, Andi Gutmans wrote: > Hi, >=20 > 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. >=20 > So what I'm thinking of is: > array(1, 2, 3) =3D=3D [1, 2, 3] > array(1, 2, array("foo", "bar")) =3D=3D [1, 2, ["foo", "bar"]] > array("key" =3D> 1, "key2" =3D> 2) =3D=3D ["key" =3D> 1, "key2" =3D> 2] >=20 > $arr =3D [1, 2, 3] > vs. > $arr =3D array(1, 2, 3) >=20 > 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. Overwhelming support from here ;-D Seriously, I personally find the [...] syntax really elegant and intuitive, and the array(...) syntax really hard to read and obfuscating. A BIG +1 Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: m.ford@leedsmet.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211=20 To view the terms under which this email is distributed, please go to http:= //disclaimer.leedsmet.ac.uk/email.htm