Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98372 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97132 invoked from network); 1 Mar 2017 20:46:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Mar 2017 20:46:54 -0000 Authentication-Results: pb1.pair.com smtp.mail=mail@pmmaga.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=mail@pmmaga.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain pmmaga.net designates 149.210.149.69 as permitted sender) X-PHP-List-Original-Sender: mail@pmmaga.net X-Host-Fingerprint: 149.210.149.69 outbound0.mail.transip.nl Received: from [149.210.149.69] ([149.210.149.69:59160] helo=outbound0.mail.transip.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 13/14-65343-A3337B85 for ; Wed, 01 Mar 2017 15:46:52 -0500 Received: from submission5.mail.transip.nl (submission5.mail.transip.nl [149.210.149.125]) by outbound0.mail.transip.nl (Postfix) with ESMTP id 3vYSD655h7z11T5g for ; Wed, 1 Mar 2017 21:46:46 +0100 (CET) Received: from mail-io0-f181.google.com (mail-io0-f181.google.com [209.85.223.181]) by submission5.mail.transip.nl (Postfix) with ESMTPA id 3vYSD30rQ1z7t8g for ; Wed, 1 Mar 2017 21:46:39 +0100 (CET) Received: by mail-io0-f181.google.com with SMTP id f84so38709356ioj.0 for ; Wed, 01 Mar 2017 12:46:39 -0800 (PST) X-Gm-Message-State: AMke39mqTex7Rm3rGuMVRepv7jmtaZeKTZPvJ8QmYBG79hcT/BoQq+i0pimv+vDnh2x9XbB66XAPaYhN9vZcgw== X-Received: by 10.107.12.40 with SMTP id w40mr9499332ioi.162.1488401198563; Wed, 01 Mar 2017 12:46:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.208.12 with HTTP; Wed, 1 Mar 2017 12:46:18 -0800 (PST) In-Reply-To: References: Date: Wed, 1 Mar 2017 21:46:18 +0100 X-Gmail-Original-Message-ID: Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary=001a113f94e8b968060549b1686c X-Scanned-By: ClueGetter at submission5.mail.transip.nl X-Report-Abuse-To: abuse@transip.nl Subject: Re: On arrays starting with a negative index From: mail@pmmaga.net (=?UTF-8?Q?Pedro_Magalh=C3=A3es?=) --001a113f94e8b968060549b1686c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Feb 15, 2017 at 7:28 PM, Pedro Magalh=C3=A3es wro= te: > Hi internals, > > I've prepared a PR (https://github.com/php/php-src/pull/2383) that would > change the current behavior of arrays when the first index is a negative > integer. > > The main goal is to make the result of array_fill more in line with what > you would expect if the start_index is a negative integer. However, the > current (and historical) result is properly documented on the array_fill > page. > > I would like to hear your feedback about this change and if you feel this > warrants an RFC. > > Best regards, > Pedro Magalh=C3=A3es > Bump on this topic as I would like to hear some feedback. As a clarification, the current implementation of the PR affects arrays in general, not only array_fill. Any array that starts with a negative index would continue from that index instead of 0. Meaning that [-2 =3D> true, true, true] would now return [-2 =3D> true, -1 =3D> true, 0 =3D> true] inst= ead of [-2 =3D> true, 0 =3D> true, 1 =3D> true]. Regards, Pedro --001a113f94e8b968060549b1686c--