Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51270 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67924 invoked from network); 14 Jan 2011 18:35:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jan 2011 18:35:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=marcin.babij@nasza-klasa.pl; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=marcin.babij@nasza-klasa.pl; sender-id=pass Received-SPF: pass (pb1.pair.com: domain nasza-klasa.pl designates 74.125.82.54 as permitted sender) X-PHP-List-Original-Sender: marcin.babij@nasza-klasa.pl X-Host-Fingerprint: 74.125.82.54 mail-ww0-f54.google.com Received: from [74.125.82.54] ([74.125.82.54:45264] helo=mail-ww0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 81/A3-48854-357903D4 for ; Fri, 14 Jan 2011 13:35:00 -0500 Received: by wwb31 with SMTP id 31so3356656wwb.11 for ; Fri, 14 Jan 2011 10:34:43 -0800 (PST) MIME-Version: 1.0 Received: by 10.227.147.129 with SMTP id l1mr1072008wbv.26.1295030083564; Fri, 14 Jan 2011 10:34:43 -0800 (PST) Received: by 10.227.132.204 with HTTP; Fri, 14 Jan 2011 10:34:43 -0800 (PST) In-Reply-To: <496E551C-85F0-423E-89FA-2C5245808320@easen.co.uk> References: <496E551C-85F0-423E-89FA-2C5245808320@easen.co.uk> Date: Fri, 14 Jan 2011 19:34:43 +0100 Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Support negative indexes for arrays and strings From: marcin.babij@nasza-klasa.pl (Marcin Babij) > Hello everyone, > > I would like to open the discussion around the support of negative indexes, as I feel a lot of developers will benefit from this syntactical sugar. > > Example: > > echo $foo[2]; // 3 > echo $foo[-1]; // 3 Negative indexes are used already - for negative indexes. What should: $foo = array(1,2,3, -1 => 4, 5, 6); echo $foo[-1]; return? Now it returns 4. > > $bar = 'baz'; > echo $foo[2]; // 'z' > echo $foo[-1]; // 'z' > > The change to PHP is quite trivial, but as it's a change to language it needs to be discussed. > > I'm happy to open a RFC, I have got a wiki account but I haven't got permission to add a wiki page. Whom do I need to contact regarding getting correct permissions to add/edit wiki pages?