Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76463 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93630 invoked from network); 13 Aug 2014 08:38:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Aug 2014 08:38:09 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.48 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.192.48 mail-qg0-f48.google.com Received: from [209.85.192.48] ([209.85.192.48:37880] helo=mail-qg0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 87/C2-00877-0F32BE35 for ; Wed, 13 Aug 2014 04:38:08 -0400 Received: by mail-qg0-f48.google.com with SMTP id i50so10554491qgf.35 for ; Wed, 13 Aug 2014 01:38:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=QnFJqxqX3GQkxBl4XE29epC8gyozBma1urnI0o0UW1s=; b=kL6UG3Zl25m65ad6gfkb+Gyd1mdvwsykv+bcqt26oeJ4HGsopyAIBMC639ss0ep2eQ dluw2kfgZB6EDZ7b4D74RXxY520K9jmVHJ5SKqik/AXcHlQzdDgxSt35e+A/l5szQlcl PEG+8m6P0pN0XZlVq0CmOzzDsnjthSC4RZ8+Wt4cgR32aqNl0771LKVLXvfgVUuB7XVF /Lqv2Q62SFv68Fxz85VUyxPsmEByBYeBp9RclnbBp2BHxwovT3P4JeJaiWOSvFDHr/A4 u7Xa82fZWGXlZYc7IjdP+rcpsDLS8Y/GzaKvjjbPwK5x73K2VjVe33NiRJjSfdpZQSEV fUPA== MIME-Version: 1.0 X-Received: by 10.140.35.176 with SMTP id n45mr4301373qgn.30.1407919130371; Wed, 13 Aug 2014 01:38:50 -0700 (PDT) Received: by 10.140.24.54 with HTTP; Wed, 13 Aug 2014 01:38:50 -0700 (PDT) In-Reply-To: References: Date: Wed, 13 Aug 2014 10:38:50 +0200 Message-ID: To: Ferenc Kovacs Cc: Sara Golemon , PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement From: pierre.php@gmail.com (Pierre Joye) On Wed, Aug 13, 2014 at 9: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 only > 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 BC > 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. I have a mixed feeling too about doing this change in 5.x. Without nitpicking, it is still a BC break. I also think that making PHP somehow consistent, less confusing, etc. while working on the PHP specs, we should really target php7 for any of these changes. As of the discussions about the discussion phase, what is one week more anyway? Especially in summer when the lucky ones are in holidays? ;) Cheers, -- Pierre @pierrejoye | http://www.libgd.org