Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37969 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65010 invoked from network); 28 May 2008 15:56:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 May 2008 15:56:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=chrisstocktonaz@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=chrisstocktonaz@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.44.29 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: chrisstocktonaz@gmail.com X-Host-Fingerprint: 74.125.44.29 yx-out-2324.google.com Received: from [74.125.44.29] ([74.125.44.29:34110] helo=yx-out-2324.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D9/69-15519-EB08D384 for ; Wed, 28 May 2008 11:56:48 -0400 Received: by yx-out-2324.google.com with SMTP id 8so213904yxm.83 for ; Wed, 28 May 2008 08:56:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=UPhpmTaLKOr4JNNvpsr2PuqBayLs4oLBkGxLBNTwBUo=; b=LtqhKyxzI0WK/LDLOgrP7ducY/HdNz/vI74WyOzoMbLYWAO9YM/24NgobjAhuiZTfAV12tab0swGEJ7xum7Hs7VrLvo4fxxu3HSrYkpgtICYN1Y/JrIGgwowI1FiN45XcZeXbfxybJkQ3aIXkyEPDLP/axtXQmH+M4SjQ9482CQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=NwPjWttj2JH/x1cgm8GEGT602sXEf15xeUjhb3ofNbrUywNA90mgJhbP4sp9J+T8KQfz4fCM9ACg0DGUouQtQN7EeC6HvXtJ62XSvUu0SrEy823qZq9EvmlZW+Y9njiiRj/Z/D3n1xO9OXbZ1I4CLP6wKpG5nesd36hqGMJZjvg= Received: by 10.150.82.27 with SMTP id f27mr5869472ybb.137.1211990203761; Wed, 28 May 2008 08:56:43 -0700 (PDT) Received: by 10.150.133.4 with HTTP; Wed, 28 May 2008 08:56:43 -0700 (PDT) Message-ID: Date: Wed, 28 May 2008 08:56:43 -0700 To: "Mailing List" In-Reply-To: <698DE66518E7CA45812BD18E807866CE01A53A06@us-ex1.zend.net> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_8298_7526964.1211990203711" References: <0412F6FE505049F7901EAB8C61774839@pc> <87.77.15519.9E47C384@pb1.pair.com> <97.F8.15519.1229C384@pb1.pair.com> <483C94EA.90507@zend.com> <483C95DD.6000006@sci.fi> <698DE66518E7CA45812BD18E807866CE01A53A06@us-ex1.zend.net> Subject: Re: [PHP-DEV] Re: Short syntax for array literals [...] From: chrisstocktonaz@gmail.com ("Chris Stockton") ------=_Part_8298_7526964.1211990203711 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline +1 for: ['foo' => 'bar'], Not sure if it was decided but -1 for ['foo': 'bar'] Here is why, Array(), is much more confusing to someone coming with no experience in php then []. Array() in most languages looks like a function call. So Array('foo' => 'bar'), verse ['foo' => 'bar'], most people will more easily understand the latter when entering into the language fresh. I.E.: $f = Array('foo' => 'bar'); $f('foo'); // comes to mind first right, might not for a php developer but for a new comer maybe? $f = ['foo' => 'bar']; $f['foo']; // great Gives our users options, and does not break any existing code or enforce new programming paradigm. The change is minor and no real cost in performance. As for existing users, I find the completely negative comments a real hindrance on the evolution of php as a language. If something does not damage the language but will offer benefits for a broad user base, as well as existing code, then let it be. I for one will change every line of code I have that uses the Array() syntax for the shorter, more WIDELY readable [] syntax. My only curiosity is if this will turn into a ecmascript morphism and we wind up with a new object proposal instead of stdclass, like $oStd = {'foo' => 'bar'}; echo $oStd->foo; ... doesn't even look all that bad but feels wrong and dirty, I think I would rather (object) ['foo' => 'bar']; :p -Chris ------=_Part_8298_7526964.1211990203711--