Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52662 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83870 invoked from network); 1 Jun 2011 12:05:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Jun 2011 12:05:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=marcel.esser@croscon.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=marcel.esser@croscon.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain croscon.com from 66.46.182.54 cause and error) X-PHP-List-Original-Sender: marcel.esser@croscon.com X-Host-Fingerprint: 66.46.182.54 relay.ihostexchange.net Windows 2000 SP4, XP SP1 Received: from [66.46.182.54] ([66.46.182.54:17107] helo=relay.ihostexchange.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 23/24-61684-F0B26ED4 for ; Wed, 01 Jun 2011 08:05:37 -0400 Received: from [192.168.1.120] (76.111.6.201) by smtp.ihostexchange.net (66.46.182.50) with Microsoft SMTP Server (TLS) id 8.3.137.0; Wed, 1 Jun 2011 08:05:34 -0400 Message-ID: <4DE62B09.6070308@croscon.com> Date: Wed, 1 Jun 2011 08:05:29 -0400 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: internals@lists.php.net References: <4DE5368A.6050603@moonspot.net> In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RFC: Short syntax for Arrays (redux) From: marcel.esser@croscon.com (Marcel Esser) My kneejerk reaction to this, as no one particularly important, is to not allow mixing those syntaxes. I looked at the RFC a minute ago, and I read a reference to a parallel solution to this being named parameters. Which, I think, is not accurate. The problem with the array() notation is definitely at deep nesting levels. The fact that arrays as arguments suddenly look nicer is basically just a bonus. I really just don't want to type array() twenty-five times in the same data structure. PS: That is not to say that I wouldn't love named parameters; I would adore them. I can't count how many times I've thought that a router would benefit enormously from being able to do that. However, using an array instead worked fine - and that is cool. - M. On 6/1/2011 8:01 AM, Arvids Godjuks wrote: > My personal feel about this is that yes, short arrays are not bad, but > things like > > $a = new A; > $a[array()]; > > just scare the crap of me when I see them. To me PHP is easy on syntax > and it's good. When I see Ruby or Python code with all it's crazy > magic I feel sick. Still one day I will have to learn one, but that > doesn't mean PHP should go that way too (i'm not alien to system > languages, I had some practice with Pascal, Delphi& C some years ago, > just wanted to go the WEB path so migrated to PHP). > > If it's not too much, it would be good to avoid such strange > constructs at all, because people are mean and they tend to do bad > things in code. >