Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96648 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17125 invoked from network); 30 Oct 2016 12:48:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Oct 2016 12:48:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=alice@librelamp.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=alice@librelamp.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain librelamp.com designates 45.79.96.192 as permitted sender) X-PHP-List-Original-Sender: alice@librelamp.com X-Host-Fingerprint: 45.79.96.192 librelamp.com Received: from [45.79.96.192] ([45.79.96.192:54454] helo=librelamp.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7B/C0-25911-C1CE5185 for ; Sun, 30 Oct 2016 07:48:34 -0500 Received: from localhost.localdomain (c-50-184-37-123.hsd1.ca.comcast.net [50.184.37.123]) by librelamp.com (Postfix) with ESMTPSA id 871EB1167 for ; Sun, 30 Oct 2016 12:48:19 +0000 (UTC) To: internals@lists.php.net References: <44244cfd-c8ad-e0a9-4e70-380a8a8c940c@syberisle.net> <01f2f3da-592b-fd23-709d-ad620422f56d@fleshgrinder.com> Message-ID: <54d72d8e-d92e-e546-7e20-728c82760a67@librelamp.com> Date: Sun, 30 Oct 2016 05:48:18 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Allow Iterator to be used with current, next, reset, key functions From: alice@librelamp.com (Alice Wonder) On 10/30/2016 05:31 AM, Rasmus Schultz wrote: > On second thought, I agree with that - changing reset() and end() > doesn't make sense, because people know them and expect them to work > in a certain way. Likely a lot of people would actually continue to > use them with intermediary variables the way they do today. Today? In PHP 5.6.x I didn't have to use intermediate variables. Being required to use them was new with PHP 7 and I suspect you will find a lot of sites still using pre 7 because they haven't taken the time to make sure every app they run works in PHP 7. All my production servers still run 5.6.x for that reason, I'm only now starting to port the apps I can now that it appears the PECL modules I need have finally all been updated. The php apps I am fixing are currently littered with code like this: $SEVENFIX = explode('.', $rs[0]->cover); if(end($SEVENFIX) == "whatever") { // do stuff } before trying the app in my 7.1.0RCx test servers they worked just fine as if(end(explode('.', $rs[0]->cover)) == "whatever") { // do stuff } So I suppose some people might "continue" to use them with intermediary but a lot of code that hasn't been ported to 7 doesn't currently.