Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102487 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97763 invoked from network); 27 Jun 2018 15:14:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jun 2018 15:14:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=spam-free@blueyonder.co.uk; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=spam-free@blueyonder.co.uk; sender-id=pass Received-SPF: pass (pb1.pair.com: domain blueyonder.co.uk designates 80.0.253.67 as permitted sender) X-PHP-List-Original-Sender: spam-free@blueyonder.co.uk X-Host-Fingerprint: 80.0.253.67 know-smtprelay-omc-3.server.virginmedia.net Received: from [80.0.253.67] ([80.0.253.67:42541] helo=know-smtprelay-omc-3.server.virginmedia.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BA/7D-01794-5E9A33B5 for ; Wed, 27 Jun 2018 11:14:46 -0400 Received: from [192.168.0.100] ([82.47.50.152]) by cmsmtp with ESMTPA id YC9afopsRbtAcYC9afA6Vm; Wed, 27 Jun 2018 16:14:42 +0100 X-Originating-IP: [82.47.50.152] X-Authenticated-User: spam-free@blueyonder.co.uk X-Spam: 0 X-Authority: v=2.3 cv=QvlwI26d c=1 sm=1 tr=0 a=TAE3a1YMiMiF8Y4yWzocug==:117 a=TAE3a1YMiMiF8Y4yWzocug==:17 a=IkcTkHD0fZMA:10 a=x7bEGLp0ZPQA:10 a=67BIL_jfAAAA:8 a=Cu1FxC3-G6jWz_ay-loA:9 a=UbxkHtOMuzNCN9G4:21 a=v_gWlc1ZhwO7xQVm:21 a=QEXdDO2ut3YA:10 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blueyonder.co.uk; s=meg.feb2017; t=1530112482; bh=t7hRqF9377+Z5Ln2kUWYFiJZVXg61rZVmOmW7SdIoWs=; h=Subject:To:References:From:Date:In-Reply-To; b=OQhRPLUQsthYMP9dqZl5DkHPlsWFMo3kbyO3tW2Y9Unrubrt8Gy7o0+CnucfvANxE j1+ofqBtjGJN+Z1S2tGxAjNR43nzxCJjpihYSZk/AOfJwSdXSaaGbZ17cZWiuESrJL bRC1y3JDWKZRUG+Apo8qugm0rrjAsUg85Cz0vASH4M4v92cfJm8V/lQdrhi2Hp9crp y3hDpS/oL1S3bRIE85Zm01l0LjHuMefKxjg5y/lgM58Wwmor7evBhjP9Qnuhg+QhHW bn4gP3HrsNp+lpWvm7HVRnDO0QINjd7NRuziYfE0Z9F9Mfevu3MniHjr+JAgcfyUwC zyDHMbqEMeCLw== To: internals@lists.php.net References: <17c367f8-3aeb-277f-36c3-f019e6d0d27a@blueyonder.co.uk> <94ff9afc-b3b0-0ae2-55bd-ce6c3936967d@gmail.com> Message-ID: Date: Wed, 27 Jun 2018 16:14:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <94ff9afc-b3b0-0ae2-55bd-ce6c3936967d@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfBVgVFdv5H6t87A0jvjZZJII30gQLvW3py4BF1nn8BxDrIPvU7Z988TAD1QZShhW0M5sAZDEkKqZAzUCi+aPLvU32W/DpruA7IA3mZe5tdWRtip7+Nip FCfAbY8VfRCk1e7y9rCAcmqzMeo3TYp6Q97MLimOqiXYbMeXB7XwNqiACO6YMO0i/c5Yrub98CjMzJ27M+hyTuZKowCU120cDoCUiMOeeFuaat4lOsOda2lc Subject: Re: [PHP-DEV] [RFC] Deprecate and remove continue targeting switch From: spam-free@blueyonder.co.uk (niel) On 26/06/18 21:49, Rowan Collins wrote: > On 26/06/2018 20:28, niel wrote: >> On 24/06/18 17:16, Nikita Popov wrote: >>> Hi internals, >>> >>> Another small deprecation for your consideration... >>> >>> https://wiki.php.net/rfc/continue_on_switch_deprecation >>> >>> Regards, >>> Nikita >>> >> IMO the proposed illustrations will lead to as much, if not more, WTF >> from other language users as current behaviour. Why? Because the >> programmer still has to account for the 'switch' in how continue >> works. This will just cause a BC problem for older code without adding >> anything for people new to PHP. >> >> My suggestion, is to make the break (no pun intended) be clean. >> Deprecate use of continue from usage to escape switch completely in >> next PHP, then remove that functionality in PHP 8. >> > > Do you mean that this code would be valid in both PHP 7 and PHP 8, but > mean different things? How is that different to the illustrations provided? That code is valid in PHP 7.0-7.3 but will have different meaning in 7.3. > while($outer) { >     while($inner) { >         switch($foo) { >             case 1: >                 continue 2; >         } >     } > } > > If so, I think that would be even more confusing. > > Regards, > Ultimately, I was trying to express what Zeev said better: > Ultimately - even after this change, C developers won't be able to use the C semantics they're used to, as (e.g. in the example in the RFC) - 'continue;' won't work as they'd expect - and they'd have to acquaint themselves with 'continue 2;'. It's true that if we 'force' them to acquaint themselves with multi-level loop control structures there's reduced 'continue;' erroneously. But unless this is really A Thing, as in, something pretty common - I think the mess involved with forcing people who have working code to try and (a) understand the change, and (b) understand their (potentially quite ancient) code flows may outweigh the benefits.