Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91231 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21688 invoked from network); 15 Feb 2016 03:49:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Feb 2016 03:49:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.54 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.220.54 mail-pa0-f54.google.com Received: from [209.85.220.54] ([209.85.220.54:35983] helo=mail-pa0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3E/40-18656-CCA41C65 for ; Sun, 14 Feb 2016 22:49:32 -0500 Received: by mail-pa0-f54.google.com with SMTP id yy13so78496002pab.3 for ; Sun, 14 Feb 2016 19:49:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=daQO/8pN+n4dU8uzchXvJXs4MkMhrWU1fAfyxXy9fIw=; b=V6LM4orZWaTwPoHGw68QIlMmYC9tpnpnrQw5v/wRM5ctG0axRX0yNlSnUb+9T4/9AS e/bonH/FSzfOqBnItzs6P8CeJtPG/LJCSZHSA7clZTybSTvO1WN2M1cJ7BVzoZV16Y43 iSWL7RKjWNxH3LJCxjO/cSaHb3BVNkUq32wRtNaK6hdznHSLVSCFePUW26NZL/Ba4zBd DqD5iCfyBQuIBqRegj6AsfTQ+O8IhFQG3q6g2FZ1nMYSFNXrORb1HSjB8rr/IOX0n3MM JsL8BnW6R/vcXPm/s1CEw8d5fjiZXBPpFREmz+uGcbYapFxY3kUI/J/RUV9hcp2xxAfN SHRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=daQO/8pN+n4dU8uzchXvJXs4MkMhrWU1fAfyxXy9fIw=; b=b/gCIYZ/1SMbhXm2jnkAwVqdThgVCVWqNNr7Mcd18Curr4aV2tZkXeeGA5WSFT5rZB LfFR/XRrlulEP6v15FhiGVx52B3Taujb9kPeW9LxOyeSRNo1hmZbrXgucKMAxTJowrhG osy6Dgi8690R1c1LqIJQnaGyL3+m/RD+rwnf6zaro0pZA2/GUbY5YwcmlLC9wpbfz+Uf pTfTtoA6dyh/hzAasTMomNkLN4kSIvfw199EDtOYGbWgH1w7vyyK6Xh53+3n/ttCe4c9 7sSNjfQFVBBQ7flLiTEYUIbi1QWLF3gaDekgt8ZYiZb6MBM7xT+wic84Jj7weUuIhPC5 eaag== X-Gm-Message-State: AG10YORkAKpV5D2Tm33UlAEMqH2fVfy0xb+DANHlzhhMI/7/g3v+/w36OHCbcAzjdJALDQ== X-Received: by 10.66.166.42 with SMTP id zd10mr20507598pab.159.1455508169848; Sun, 14 Feb 2016 19:49:29 -0800 (PST) Received: from Stas-Air.local ([2602:304:cdc2:e5f0:c073:75a3:926b:cd8a]) by smtp.gmail.com with ESMTPSA id to9sm34497176pab.3.2016.02.14.19.49.28 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 14 Feb 2016 19:49:28 -0800 (PST) To: Nikita Popov , =?UTF-8?Q?Fran=c3=a7ois_Laupretre?= References: <56A3A01F.1020500@php.net> <56BC988F.7080101@php.net> <56BD1CD4.8070206@php.net> Cc: Andrea Faulds , PHP internals X-Enigmail-Draft-Status: N1110 Message-ID: <56C14AC6.7060307@gmail.com> Date: Sun, 14 Feb 2016 19:49:26 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Generalize support of negative string offsets From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > This fix has been merged into master (targeting 7.1), thanks! I'm not sure that was such a good idea (sorry, didn't have time to write about it before the weekend). Introducing a new warning into previously working code is a BC break, and one that wasn't even discussed in its own thread. Moreover, there's one more BC break in this patch - before it, for this code: $str = "abc"; $str{4} = ''; var_dump($str); the $str was string of length 5, with this fix it would be string of length 3, unchanged. Which may break other code (e.g. one composing complex formats) in very subtle ways. And I'm not sure that current behavior is an improvement. > 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. -- Stas Malyshev smalyshev@gmail.com