Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91233 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34027 invoked from network); 15 Feb 2016 07:01:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Feb 2016 07:01:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.177 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.214.177 mail-ob0-f177.google.com Received: from [209.85.214.177] ([209.85.214.177:34497] helo=mail-ob0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 66/C1-18656-DD771C65 for ; Mon, 15 Feb 2016 02:01:49 -0500 Received: by mail-ob0-f177.google.com with SMTP id wb13so200637375obb.1 for ; Sun, 14 Feb 2016 23:01:49 -0800 (PST) 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=zTwcrBuK91MhF6H59QtRT4ZuDGTyzp1odzFRfbEunCI=; b=0KJZyPweyQqkmIGmmPx2y4dqFBmFVPEiPdV+e2GBOZSa093AsIU4JHj0JV1F1cv/K0 4oxt+JBOhXNajv8CEk2BW+TqCIJMKU2JL+0sQr740Q0E5h25XDsgRSoV27o8Nsqf3cgq o8h5MT1BMPFA7+4UId+9s0wWjDtbW9cbTPpvW5HeYKw6mN3T5/sCO97jJhNCJg9FhQKs tpx/mYtGYLL2u9bxn6F7AI4o5MEmDRL9KhMWK9endqybgwBD3MC6lZkK/1kRuDAclX46 thiaUPzemRoqZ+NWjmACc+nXMLF2r4J0jID+Cvt2Apij+GjISi0vXVtWsNWfyeJB0Hin W6xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=zTwcrBuK91MhF6H59QtRT4ZuDGTyzp1odzFRfbEunCI=; b=HOQW1uNQmUFLbVDAXnitINmvaTZzU+PMy027bVUEZJBuY4Guc7xFckzf5PTrL/lYh9 tpQgN/MHOSk6izDML6tOzb8X0rp1Z9Kq7r7qSOuoZCAkjwUvmu8tw6MMvvZIKh+BkcMp Yu2MrJXXJoLuUOux/jdYZ6DBJfuLCpAT9Npe9t17sMlK7EwhvQpdIrl1XJBeQ/UKsT8S PofpsJhvbQtIttL7RZSceXwaf88vOFRXb0oTA1sCM9CElm99nYiUfgT6QOvYd2V2Mc+D jN5A/zPlIYEIHyKrP+TAaCi8nGHAxPPPv71fO7RpJpVNzwK83mD9+t6oSOtD3Vb6hvTt G+jw== X-Gm-Message-State: AG10YOTOUAAL7OXT0boPB02Anm5I/EW8P2cp4ysKUwvKOy1Q9bAL4Ia7RBIpb6evmCAir6eI2Qgab8cS07Qwsg== MIME-Version: 1.0 X-Received: by 10.60.63.81 with SMTP id e17mr10848903oes.21.1455519705130; Sun, 14 Feb 2016 23:01:45 -0800 (PST) Received: by 10.202.95.68 with HTTP; Sun, 14 Feb 2016 23:01:44 -0800 (PST) Received: by 10.202.95.68 with HTTP; Sun, 14 Feb 2016 23:01:44 -0800 (PST) In-Reply-To: References: <56A3A01F.1020500@php.net> <56BC988F.7080101@php.net> <56BD1CD4.8070206@php.net> <56C14AC6.7060307@gmail.com> Date: Mon, 15 Feb 2016 14:01:44 +0700 Message-ID: To: Yasuo Ohgaki Cc: Nikita Popov , Andrea Faulds , Stanislav Malyshev , =?UTF-8?Q?Fran=C3=A7ois_Laupretre?= , PHP internals Content-Type: multipart/alternative; boundary=001a11c256b6fcf085052bc99675 Subject: Re: [PHP-DEV] [RFC] Generalize support of negative string offsets From: pierre.php@gmail.com (Pierre Joye) --001a11c256b6fcf085052bc99675 Content-Type: text/plain; charset=UTF-8 On Feb 15, 2016 1:15 PM, "Yasuo Ohgaki" wrote: > > Hi all, > > On Mon, Feb 15, 2016 at 12:49 PM, Stanislav Malyshev > wrote: > >> Another issue mentioned in this thread is the spurious array conversion > >> that happens for empty strings. We have an existing bug report for this: > >> https://bugs.php.net/bug.php?id=53432 I've created a PR to fix this > >> issue: https://github.com/php/php-src/pull/1764 If there are no > >> objections, I'll merge this for 7.1 as well. > > > > This one looks like a bug, converting string to array is really weird. > > And one more reason to never use [] for string offsets - clearly, the > > bug stems out of confusion between arrays operation (which expects > > conversion to array) and string operation (which expects string). > > In any case, this needs a note in UPGRADING as behavior change. > > I fully agree {} and [] usage. > - {} only for string > - [] only for array > Simple is better if it satisfies all of our needs. > > Since PHP allowed [] for strings, how about allow it, but deprecate it > by doc in 7.1, deprecate(Raise error) it in 7.2, then remove it by > 7.3? If anything then it can be removed by 8. --001a11c256b6fcf085052bc99675--