Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37978 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15281 invoked from network); 28 May 2008 19:12:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 May 2008 19:12:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=greg@chiaraquartet.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=greg@chiaraquartet.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain chiaraquartet.net from 38.99.98.18 cause and error) X-PHP-List-Original-Sender: greg@chiaraquartet.net X-Host-Fingerprint: 38.99.98.18 beast.bluga.net Linux 2.6 Received: from [38.99.98.18] ([38.99.98.18:51790] helo=mail.bluga.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 93/56-10063-59EAD384 for ; Wed, 28 May 2008 15:12:23 -0400 Received: from mail.bluga.net (localhost.localdomain [127.0.0.1]) by mail.bluga.net (Postfix) with ESMTP id 0644F91E0BF; Wed, 28 May 2008 12:12:24 -0700 (MST) Received: from [192.168.0.106] (CPE-76-84-4-101.neb.res.rr.com [76.84.4.101]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bluga.net (Postfix) with ESMTP id A80EE91E0B2; Wed, 28 May 2008 12:12:23 -0700 (MST) Message-ID: <483DAE91.7020505@chiaraquartet.net> Date: Wed, 28 May 2008 14:12:17 -0500 User-Agent: Thunderbird 2.0.0.14 (X11/20080505) MIME-Version: 1.0 To: Stan Vassilev | FM CC: PHP Developers Mailing List References: <0412F6FE505049F7901EAB8C61774839@pc> In-Reply-To: <0412F6FE505049F7901EAB8C61774839@pc> Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: Re: Short syntax for array literals [...] From: greg@chiaraquartet.net (Gregory Beaver) I've thought about allowing [] for a while and personally have come up with my own litmus test for new features. 1) is the syntax missing from the language? 2) if so, does the syntax add missing functionality or significant maintenance benefit? 2) if not, does the new syntax add significant value? #1 no, array() is the same [-1] #2 not applicable [0] #3 [-.5] * can't google [] * makes arrays simpler to type and take up less space * adds potential for confusion between array access and creation: $a['hi']; $a;['hi']; both are now suddenly valid PHP * syncs with javascript and other languages * opens pandoras box - PHP is simpler than Perl because there are not 20 ways of doing the same thing with different punctuation shorthands So I find #1 is -1, #2 is 0, #3 is about -.5 Although the idea is somewhat attractive, I've found no drawbacks to array() syntax, and plenty of dangers with adding any new alternate syntax, and this ultimately makes my vote -1 Greg