Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91235 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45200 invoked from network); 15 Feb 2016 09:27:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Feb 2016 09:27:08 -0000 Authentication-Results: pb1.pair.com header.from=arvids.godjuks@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=arvids.godjuks@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.53 as permitted sender) X-PHP-List-Original-Sender: arvids.godjuks@gmail.com X-Host-Fingerprint: 209.85.215.53 mail-lf0-f53.google.com Received: from [209.85.215.53] ([209.85.215.53:36449] helo=mail-lf0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 31/53-18656-9E991C65 for ; Mon, 15 Feb 2016 04:27:07 -0500 Received: by mail-lf0-f53.google.com with SMTP id 78so85095495lfy.3 for ; Mon, 15 Feb 2016 01:27:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=KDZsvtoxK3n6/5h6mMebIdyfv05CFfM3i1LBMCD7MO8=; b=CDf0rAZmb9pQ7skmdCohFHiOYY1ZSn/XWYDPY/O9nv6Uk9Pc4uGCrYPaqhKj76S8AA eEhK3WrbAd9vg7AkniHHb+pq4jWg4C6h3DHjlgxOMfZa28NaW+f+99ykRGuY+gB9SnGZ 5xR6pXqhyxAptvMeGDaB5u2q4OpSg8ocam8kUsSp4smU0TRJONxLj904nnKQV1uZavSR p2dd1nFlCP9E4MvVXDCvSLfHTRrhFyOFza/cqsOuprTrxhVLuQ4KVueyAROK6jSnlNtZ Ffc+pFLPf/NJcan7gscEWDAAUlqoi0JzO7UIoehW8B5o1Tj/zHXMUZmbzCNT41CCUGXA 2tMQ== 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:from:date :message-id:subject:to:cc:content-type; bh=KDZsvtoxK3n6/5h6mMebIdyfv05CFfM3i1LBMCD7MO8=; b=SiKDOM/nTZWuDIANAdH/mmOn90kmE+XSsiS/KZ8AbomYJJwt+LNYqm0daYxmVQY8fA C1rA0URlbbC0d6XuWsVZZNPc1Vg5oTcECwPRL+G08v8Es9qtWP5VPULq043J9WcKSSkr IX6icK+ZCrcXd2E2x2RSY1vQH2m4/B1SWt7K+gasfUDjFLcPPed35cvXCuKGmPD+z5kL pdotZxADQR6d+dI+yLejwCfNczK9DCZPC7nrNZOmgvq3CdbwpUqJGliVrJp205BVS6eC otlYPVhfnfMgKDeSljxOHnv7vvKD4hU/E9APvqr4cZ3/fX1pmNfsJeICW46YmgTpKSBx 78zw== X-Gm-Message-State: AG10YOQdDAtZfk36ZLShTPFu06/n39WpwkOSAKStx607/Pmlt1k/Al0ZmJFfmL4JwYn4vmRZu5Jn4aulE8wAsA== X-Received: by 10.25.31.80 with SMTP id f77mr5456474lff.18.1455528422276; Mon, 15 Feb 2016 01:27:02 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.151.98 with HTTP; Mon, 15 Feb 2016 01:26:42 -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 11:26:42 +0200 Message-ID: To: Yasuo Ohgaki , Stanislav Malyshev Cc: Andrea Faulds , =?UTF-8?Q?Fran=C3=A7ois_Laupretre?= , Nikita Popov , PHP internals Content-Type: multipart/alternative; boundary=001a114022089207a9052bcb9e79 Subject: Re: [PHP-DEV] [RFC] Generalize support of negative string offsets From: arvids.godjuks@gmail.com (Arvids Godjuks) --001a114022089207a9052bcb9e79 Content-Type: text/plain; charset=UTF-8 On Mon, 15 Feb 2016 08:16 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? > > Regards, > > -- > Yasuo Ohgaki > yohgaki@ohgaki.net > > Hello, As a user-land developer I approve this message (with correction from Pierre that final removal should be in PHP 8 and keep it deprecated in PHP 7.1 by docs, 7.2 with a error message). Regards, Arvids Godjuks, Areto Development. --001a114022089207a9052bcb9e79--