Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91234 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35701 invoked from network); 15 Feb 2016 07:11:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Feb 2016 07:11:13 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.171 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.161.171 mail-yw0-f171.google.com Received: from [209.85.161.171] ([209.85.161.171:36641] helo=mail-yw0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7E/12-18656-01A71C65 for ; Mon, 15 Feb 2016 02:11:12 -0500 Received: by mail-yw0-f171.google.com with SMTP id e63so13577439ywc.3 for ; Sun, 14 Feb 2016 23:11:12 -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=aLxbfyRfCumn91U4MBZmonNvLHRYekWQ2k+cRS0sB1I=; b=bH54CwdRzQdEZ1TmWwPIFsdQYqj6lxFtXPfrzoTrxW8ghNlr2sQzfb/Sxy0ZKNzZJs qPFWjhX8J5aji6nnBIA/mN1F0DLT5a7pxOFjDPUo5qPeGbxKsM8/nGX4pctYVFJv4JSg IURNwQOsoJurkDMUF5qIn640vMBwohgnQXBBg7nBhn8S/lWWcdrzDMMYxNrKAEKwFAa8 0zOjV8/6olcvFX7I0A9Afr7vL0XuarEDPQPo226sOAkChafLBQlg1ZbXvms/kzsArRCR bKCDkOqiksjZ28WSQaDuswsPPLc9cPEpk9FbP+Myuxnkb6qQDvFgRupi9Q6HyD5XXkTp dGGw== 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=aLxbfyRfCumn91U4MBZmonNvLHRYekWQ2k+cRS0sB1I=; b=bT72zXNXVCPUqBIDZY0rTFaGxfire6m7qjSWCkU/FzCJMp50Skiia4CXaZRaRWuaxu QCfzbWgzds8DFbIKwEeUM1mPU+w7XbfdnhosPPyiQD7jOpbs7+tRnGIAdjwqgGRzGndQ zeOx6g67FzaosrnA7CmJvOmfcDenaa9YAjVkE5abz1cgN4X9FkjoUigNQ+nAlorI986h kFregrkGFUch687AdTF4B9v6ownygVQx/6om57owDcKlgDWep/uXDHmHvbFNOPCDYLkJ Pz+dDEqHP0NSyfqdtyuEhoGXbk6SzRPzuUGXsrbV9xO7LVyklXFa4biN3nyVfrCTf48M Oucg== X-Gm-Message-State: AG10YORXGXolL38m5O+wMmUPj5fzoaFjCKrGiDnA2VyLxnHgluoyoTPYQ8V/VX2QaefJWMiT6000uZ0u/3ilJQ== X-Received: by 10.129.60.12 with SMTP id j12mr9124269ywa.86.1455520269688; Sun, 14 Feb 2016 23:11:09 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.129.109.22 with HTTP; Sun, 14 Feb 2016 23:10:30 -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 16:10:30 +0900 X-Google-Sender-Auth: 5zoKHePz7yk6gYESL8rQ1lnQ1ZU Message-ID: To: Pierre Joye Cc: Nikita Popov , Andrea Faulds , Stanislav Malyshev , =?UTF-8?Q?Fran=C3=A7ois_Laupretre?= , 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 Pierre, On Mon, Feb 15, 2016 at 4:01 PM, Pierre Joye wrote: > 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. Good enough for me! -- Yasuo Ohgaki yohgaki@ohgaki.net