Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76462 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91035 invoked from network); 13 Aug 2014 08:13:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Aug 2014 08:13:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=james@notjam.es; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=james@notjam.es; sender-id=pass Received-SPF: pass (pb1.pair.com: domain notjam.es designates 209.85.192.173 as permitted sender) X-PHP-List-Original-Sender: james@notjam.es X-Host-Fingerprint: 209.85.192.173 mail-pd0-f173.google.com Received: from [209.85.192.173] ([209.85.192.173:38390] helo=mail-pd0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 25/52-00877-54E1BE35 for ; Wed, 13 Aug 2014 04:13:58 -0400 Received: by mail-pd0-f173.google.com with SMTP id w10so14002153pde.4 for ; Wed, 13 Aug 2014 01:14:39 -0700 (PDT) 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=ynsxsnJI/ATTHesqOBhd81HXHGgsXNL/8WOQctnY99M=; b=PS+N3kla7uMv1L5bliH2tF2hn3SIlqpdrWgEqudIinOxBZlhVKIOZ9x+MUGUHJ/heW X2P7wwYkzZQ+pjMdiJOAIBOecsMtlGFyZlMHeDkP3gCR7vlIVEwBcwVrK672cJf+oSUe O2CUQdkqT6w9GC5SoRGsOf+Lc6fySvHW2wyUMoK6ATFrEou2e0iHkaPmoDPUvAqGYuTA a4qoH+RtlaS4a7fprKp86aFlkOabgJLVfVkne8hH+fLuPwppsxGNKc5l6YjUxfcS5Wbb WYqNBAdfeSvDZ7hNIVd6GVhTweC73pNrg91j21RbFjcaydB8rjlDe7T2x3vZnZ08Zd5y xUag== X-Gm-Message-State: ALoCoQnOKT2aY1hwHgf4nPFo75gwZ1BSes2Ri79dsKqHTHEerpy+J8dsRsNNlLkOHZr15lfyI7gm X-Received: by 10.70.63.74 with SMTP id e10mr2605100pds.87.1407917679451; Wed, 13 Aug 2014 01:14:39 -0700 (PDT) Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) by mx.google.com with ESMTPSA id am2sm1244855pbc.59.2014.08.13.01.14.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 13 Aug 2014 01:14:38 -0700 (PDT) Received: by mail-pd0-f173.google.com with SMTP id w10so14002113pde.4 for ; Wed, 13 Aug 2014 01:14:38 -0700 (PDT) X-Received: by 10.68.252.229 with SMTP id zv5mr2837310pbc.16.1407917678071; Wed, 13 Aug 2014 01:14:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.70.51.8 with HTTP; Wed, 13 Aug 2014 01:13:57 -0700 (PDT) In-Reply-To: References: Date: Wed, 13 Aug 2014 04:13:57 -0400 Message-ID: To: Ferenc Kovacs Cc: Sara Golemon , PHP internals Content-Type: multipart/alternative; boundary=047d7b16059f131aca05007e617b Subject: Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement From: james@notjam.es (James) --047d7b16059f131aca05007e617b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Just saw the RFC today so I hadn't been able to comment on it until now.. If we are getting rid of it wouldn't it be better to emit an E_DEPRECATED per https://github.com/imnotjames/php-src/compare/switch.default.multiple-depre= cated and then remove it in the next major release? This has been known to at least one person for many years if 034.phpt is to be believed. I could see where people would use it - there are reasons to, even if they are poor in choice to do so. I entirely believe this behavior is weird and should be removed. However, breaking backwards compatibility in a minor release because the incomplete spec says so is kind of odd. A BC break is a BC break, which doesn't belong in a minor revision. Regards, James On Wed, Aug 13, 2014 at 3:47 AM, Ferenc Kovacs wrote: > On Wed, Aug 6, 2014 at 6:38 AM, Sara Golemon wrote: > > > https://wiki.php.net/rfc/switch.default.multiple > > > > 'Cause this code is silly (even if it had case blocks), but we allow it= : > > > > switch ($expr) { > > default: > > notExecuted(); > > break; > > default: > > executed(); > > } > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > Hi, > > sorry to jump in this late, but I'm not sure that it is a good idea to on= ly > reject the multiple default blocks but keep the ability to have the same > case multiple times: > http://3v4l.org/eZdPU > in this regard I think the current status is more consistent as it would > after merging this patch. > and I also think that this isn't an important enough issue to warrant a B= C > break (albeit this is the better kind of BC: probably doesn't effect too > many people, and they will be clearly notified about the error at compile > time) so I voted no based on this two thing. > > > -- > Ferenc Kov=C3=A1cs > @Tyr43l - http://tyrael.hu > --047d7b16059f131aca05007e617b--