Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62607 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20205 invoked from network); 31 Aug 2012 13:24:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Aug 2012 13:24:41 -0000 Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.42 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.210.42 mail-pz0-f42.google.com Received: from [209.85.210.42] ([209.85.210.42:46285] helo=mail-pz0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A8/F1-09246-81BB0405 for ; Fri, 31 Aug 2012 09:24:41 -0400 Received: by dalf4 with SMTP id f4so1876373dal.29 for ; Fri, 31 Aug 2012 06:24:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=nuOg1ui2mj7Jyzz02w+jZsOqPmcGhV1P1c86pCmSP98=; b=mj09BFFAKZgcYXZw0kY9rWm78Evo2eMCuDyrzQSdom0BVKr+La7/VlI6HXO0gSYmPG XsOL8WeQsrWMbrOxBhMwncYZAzktFOMPgtdy/DNvApQHB7yq/Rmk21RHzKnKLQVGMJmv deHCnmVmi2qn/BWPgklCIrol20BQkr8CVFMMpB/Hik+mLKF/rDBnGpY+wxDMCtx6CZru fSCBHmBV0OtYr+f2P1aQ6boy7xxqW0IeOyfPslHkIjWNPm8NouSvYocSDXtiUsudbDx7 QNNxU6oJOWtbA4jsOjcR1XqytDW0yOak80LI3udZsTqWdFyfwZDg1OQbmnxq7YzdlH60 V4qA== MIME-Version: 1.0 Received: by 10.68.221.225 with SMTP id qh1mr17606183pbc.50.1346419477938; Fri, 31 Aug 2012 06:24:37 -0700 (PDT) Received: by 10.68.211.37 with HTTP; Fri, 31 Aug 2012 06:24:37 -0700 (PDT) In-Reply-To: References: Date: Fri, 31 Aug 2012 15:24:37 +0200 Message-ID: To: Rasmus Schultz Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=e89a8ff255c0b3837504c88fb638 Subject: Re: [PHP-DEV] Support negative indexes for arrays and strings From: tyra3l@gmail.com (Ferenc Kovacs) --e89a8ff255c0b3837504c88fb638 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, Aug 31, 2012 at 3:14 PM, Rasmus Schultz wrote: > Having thought about this for a while, I think this is a bad idea - here'= s > why: > > $array =3D array(1001, 1002, 1003, 1004); > > $number =3D $array[-1]; // =3D> 1004 > > $number[-1] =3D 1005; > > $number =3D $array[-1]; // =3D> ???? > > Obviously, the last statement must return 1005, since otherwise that > value would be inaccessible. > > maybe you wanted to write $array[-1] =3D 1005; instead of $number[-1] =3D 1005; ? otherwise I can't see the problem that you are mentioning. could you clarify? --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --e89a8ff255c0b3837504c88fb638--