Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:5265 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20119 invoked by uid 1010); 5 Nov 2003 19:03:18 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 20070 invoked from network); 5 Nov 2003 19:03:17 -0000 Received: from unknown (HELO mail.digitalims.net) (216.58.226.166) by pb1.pair.com with SMTP; 5 Nov 2003 19:03:17 -0000 Received: (qmail 25826 invoked by uid 778); 5 Nov 2003 19:03:17 -0000 Received: from unknown (HELO corp.digitalims.com) (65.221.143.39) by mail.digitalims.net with SMTP; 5 Nov 2003 19:03:17 -0000 X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Wed, 5 Nov 2003 13:03:16 -0600 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PHP-DEV] Proposal: Array syntax Thread-Index: AcOjLAGJurzOUf3ZSeOI6j8Ir0Xp4wAo2hXQ To: Subject: RE: [PHP-DEV] Proposal: Array syntax From: DEnderson@DigitalIMS.com ("David Enderson") I have read all the debate on this and found it very interesting. You guys were generating comments faster than I could read them! lol. I have used PHP constantly for 2 years. Most of that time has been spent using arrays very extensively and often as function parameters. For what my vote is worth, I strongly favor the newly suggested notation (+1). I'm not going to try to restate all the pros discussed and address all the cons. I prefer not to have multiple ways to do things and I found the list() function to be very counter-intuitive. I was thrilled when foreach() came out and deprecated while(), list(), each() syntax. Typing "array()" isn't very many more letters, that's true, but I type it A LOT! lol. I sometimes use it as a parameter, and VERY often have to use it to initialize variables before doing array_push() or setting array items inside loops. Using: $a =3D []; would be wonderful and much less clunky. As far as extending the syntax to the list() command...well...I would prefer to just find a way to deprecate it entirely, but that is probably not possible. So I guess even though it would seem to make sense I would have to vote against that because it SETS the values of its "parameters". Yes, it may be the way another language does it. All languages borrow from others, as recent discussions regarding foreach() and {} demonstrate. I believe the ultimate goal of PHP is to have a "quick and dirty" language that is easy to read, use, and learn. While Rasmus's comment about no-magic made me stop and examine this for a while, I believe it fits all those goals nicely and is an elegant reason to make an exception to the no-magic rule. No, I don't want to see stuff like: if ([1][0] =3D=3D 1) { but as someone pointed out, you can make anything look nasty in C-syntax derived languages. --David -----=3D+=3D----- David Enderson Programmer Digital IMS