Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52703 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8225 invoked from network); 1 Jun 2011 20:37:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Jun 2011 20:37:06 -0000 Authentication-Results: pb1.pair.com header.from=mike503@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=mike503@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: mike503@gmail.com X-Host-Fingerprint: 209.85.214.42 mail-bw0-f42.google.com Received: from [209.85.214.42] ([209.85.214.42:33060] helo=mail-bw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5F/51-32367-1F2A6ED4 for ; Wed, 01 Jun 2011 16:37:06 -0400 Received: by bwz18 with SMTP id 18so426543bwz.29 for ; Wed, 01 Jun 2011 13:37:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=eENjTLBttYmfMsEjW2ZbPcZIuJGuoyDJcVH+OEa54v4=; b=nawywVQeMIxx7H6W+QjaH8/V9utObGaBQl1BBeEW5rq5rjUqld9R0yjU4RKdj8ZhQm NiVfa3ERc++Onggzj7td4WnTnc/xefv35KAhsJQSKaFMYCM/2tozRMUxCDHHzdiScAJa fisFu/g28lSennUI+fFl39Gvfxw2qmgJNXrZg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=r5lQLEjUIwUkL0T0ccnBH1SAjDCAKgplEl4sXZHbYBFs6NzcnJHCzbN1Gr+9v00bAw /BZ8Eb6MqzdQ1W7yUkAKnAMkOh9E85Cij2OC+WHoM6wfvYl6JUa3mgAaUTnePsqRN2Xe HDPG59GhR432BOba6pCcYp3ixhS5+meFbq7M0= MIME-Version: 1.0 Received: by 10.204.143.141 with SMTP id v13mr1451225bku.203.1306960622004; Wed, 01 Jun 2011 13:37:02 -0700 (PDT) Received: by 10.204.140.16 with HTTP; Wed, 1 Jun 2011 13:37:01 -0700 (PDT) In-Reply-To: References: <4DE5368A.6050603@moonspot.net> <8BEEEE49-8DA3-4634-BF9C-120F7A15B613@roshambo.org> Date: Wed, 1 Jun 2011 13:37:01 -0700 Message-ID: To: Pierre Joye Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] RFC: Short syntax for Arrays (redux) From: mike503@gmail.com (Michael Shadle) On Wed, Jun 1, 2011 at 1:01 PM, Pierre Joye wrote: > I modified the vote page, pls move your votes to the desired syntax > (or global -1) This is a good idea to group things like this. Back on the soapbox. All of this is just to reduce typing "array" (5 characters) before things? Old: $foo = array('a' => 'b', 'c' => 'd'); More than likely new: $foo = ['a' => 'b', 'c' => 'd']; 5 character difference for each array being saved. That's it. At the expense of syntax highlighters, IDEs, books, all becoming outdated and need to be updated. For a language construct that has been around for what, 10 years? Oh, and for anyone desiring a ":" for this new shorthand, why stop at array shorthand. Why not change this from: foreach($foo as $key => $val) To: foreach($foo as $key: $val) That would save one character for each array iteration like that. Also - if we're worried about saving characters and shorthand why not just remove the "$" language construct? That's a LOT of keystrokes. In my WordPress install, that's 75,412 characters saved. Versus 6,960 "array(" matches, which would save 34,800 characters. These were quick examples from a coworker. Just another PHP user who said "wait why would they make another way to express an array?"