Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91232 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31135 invoked from network); 15 Feb 2016 06:15:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Feb 2016 06:15:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.175 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.161.175 mail-yw0-f175.google.com Received: from [209.85.161.175] ([209.85.161.175:33831] helo=mail-yw0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 43/61-18656-C0D61C65 for ; Mon, 15 Feb 2016 01:15:41 -0500 Received: by mail-yw0-f175.google.com with SMTP id h129so107928813ywb.1 for ; Sun, 14 Feb 2016 22:15:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=fqI6sQMDFCN7RSbbbaaI7HO7TeXs23Yv7VWcyG8XH3I=; b=CYoRlyhSz0ZSjyFDIqUhCd+mij/BdpmvlSejraxvS7PYKE6VMTaHbGocvgLAeAhXuh CNuGJv/BlKEOpo0tUe+hBS4yS/mHkEtQ6IID1AHdY2BrQ1h4fqdZMIxuxUve782e36oZ SLod65H7D8VsyHXf2wy7mAwy9f/KHlwPjf0o6TLdmHuOncwOSffl+IAb2hgF+Yp1K57j Oo5vQFUtHoyZbcOr2C7nuD7V2Xzx4fP2pW7pwTknLEnlaV6IxQPhQcil42zt7D+wDWSm I9ylPaSF91UCyZLA++LPtuD5TB/KqpWgnVn+qasbfH86XUoHf+65k4z0XdGIhFa3QxSS wcSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=fqI6sQMDFCN7RSbbbaaI7HO7TeXs23Yv7VWcyG8XH3I=; b=QDqcG3pmKOi2+c9z6ZqBvLyyEL2SlWNcsbxu/2k6v2NZNoXcvyZYUxDMbaZ7tBZjaP QOe07ujz4LIrbu7T52Uwn66OlS8RgXVzKajTGO8iGR8N2Fj9hqeVDBulQj7Dv5DPHCf+ XIMbkZha07n/746hXxOhRZZECsMIM1bOd797fAR9dfVeIrO0ZRKc+bZDcHfVMolHzUD+ hmm8aVx2NxvLNVdWAseW04W95eQofGQ8h3oar10hO1dREQtcem17wnuggOjz7DYu+Z7U 3bpHaN7OSU/brGGJ0cjYgnRdhMreuhC+S+PBcYpkeGmrS767nv0Yd3TGVWO4aeE3MNbk rw+A== X-Gm-Message-State: AG10YORqQfRtgOgo+ehNIPOAGjRmx9DdLMcJMaPwgorKGNWLUpfVDnALUY0DIZlmN6AjkYCylKs0AaRc7t3y5A== X-Received: by 10.129.128.193 with SMTP id q184mr7901466ywf.220.1455516938339; Sun, 14 Feb 2016 22:15:38 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.129.109.22 with HTTP; Sun, 14 Feb 2016 22:14:58 -0800 (PST) In-Reply-To: <56C14AC6.7060307@gmail.com> References: <56A3A01F.1020500@php.net> <56BC988F.7080101@php.net> <56BD1CD4.8070206@php.net> <56C14AC6.7060307@gmail.com> Date: Mon, 15 Feb 2016 15:14:58 +0900 X-Google-Sender-Auth: PYv_qceYzqjwqEDKdva5y2MHkbI Message-ID: To: Stanislav Malyshev Cc: Nikita Popov , =?UTF-8?Q?Fran=C3=A7ois_Laupretre?= , Andrea Faulds , PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] Generalize support of negative string offsets From: yohgaki@ohgaki.net (Yasuo Ohgaki) 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? Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net