Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55770 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56275 invoked from network); 9 Oct 2011 23:31:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Oct 2011 23:31:43 -0000 Authentication-Results: pb1.pair.com smtp.mail=petercowburn@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=petercowburn@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.44 as permitted sender) X-PHP-List-Original-Sender: petercowburn@gmail.com X-Host-Fingerprint: 209.85.210.44 mail-pz0-f44.google.com Received: from [209.85.210.44] ([209.85.210.44:34908] helo=mail-pz0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C4/10-53952-DDE229E4 for ; Sun, 09 Oct 2011 19:31:42 -0400 Received: by pzk32 with SMTP id 32so30690428pzk.3 for ; Sun, 09 Oct 2011 16:31:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=pvNK1B7lJDmjJjI/hdwVbGOc2x6fDLGuKnvmVtqIezo=; b=FrMI9reepB9tK/90tx0JPZtabh9thhoUa6f0AGzs+ImpdUmx3xU0yLVWz8cF72nOQJ JOLa6/w5XCHv0KOEK1gDNq3hQIM0geaT387vr4qmvEUVkBXupd3r5WtRuIOFJC3di4jM cA7yvXuWm0wRlTxk9yvPbA6nPCKZzvLaKf+Ik= Received: by 10.68.6.98 with SMTP id z2mr33048021pbz.36.1318203097213; Sun, 09 Oct 2011 16:31:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.60.3 with HTTP; Sun, 9 Oct 2011 16:30:52 -0700 (PDT) In-Reply-To: References: Date: Mon, 10 Oct 2011 00:30:53 +0100 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Array dereferencing using alternative array syntax From: petercowburn@gmail.com (Peter Cowburn) Hi Nikita, On 9 October 2011 18:14, Nikita Popov wrote: > Hi list! > > PHP 5.4 added array dereferencing support (e.g. `func()[1]`), but the > grammar seems to lack support for dereferencing using the alternative > array access syntax (e.g. `func(){1}`). Was this done on purpose or > was it just forgotten? I remember mentioning this on the list a while back, but didn't get any further comment (it was an aside to a related thread). I'd like to see the curly brace alternative added, if only to be consistent with the existing syntax to access array/string values that can be used elsewhere. > > Some links: > > http://lxr.php.net/xref/PHP_TRUNK/Zend/zend_language_parser.y#array_function_dereference > http://lxr.php.net/xref/PHP_TRUNK/Zend/zend_language_parser.y#array_method_dereference > http://lxr.php.net/xref/PHP_TRUNK/Zend/zend_language_parser.y#reference_variable > (example of grammar with alternative syntax) > > Nikita > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >