Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76374 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35109 invoked from network); 6 Aug 2014 10:44:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Aug 2014 10:44:23 -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:46717] helo=mail-qg0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9E/33-13038-60702E35 for ; Wed, 06 Aug 2014 06:44:22 -0400 Received: by mail-qg0-f48.google.com with SMTP id i50so2411693qgf.7 for ; Wed, 06 Aug 2014 03:44:49 -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=SWZzbNAgUQuiF8603VnL77Rff7JMO33INt7oaUOfySU=; b=gExFGJSW+MfRAlVwRaP46nJ85Y6Tf7rVdkrZ7DZOfSK0HEW7LPFq6eZRFYDefBqAMG dd+035QLEWNA8zCWvrCh9WbO3eG+axOB4t/ECUeD95dFC7Dil3HhcgjFeXA12OSlbERT NYGXeNRqLgHQ4cK76el+zNLgVeo4w6Ekgc5IcdDCRH8SXCpKJRB/n8CXBNmehOY38b7j +1sC7vR1svZJRI8uLLnc5kjSJn2X39guCIEJ9sZlJmU/q6z8a2zObse5gG0+ivB9LYEL O1KTBSPyJsvdQ56+v7ZIAllEoGlnwkqBdm/N7ZuSD8EruaEnvZ4CWBxPVcIitRm4XOBX +rSA== MIME-Version: 1.0 X-Received: by 10.224.43.196 with SMTP id x4mr15497472qae.63.1407321889758; Wed, 06 Aug 2014 03:44:49 -0700 (PDT) Received: by 10.140.24.54 with HTTP; Wed, 6 Aug 2014 03:44:49 -0700 (PDT) In-Reply-To: <53E2006E.6080809@gmail.com> References: <53E2006E.6080809@gmail.com> Date: Wed, 6 Aug 2014 12:44:49 +0200 Message-ID: To: Rowan Collins Cc: 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 6, 2014 at 12:16 PM, Rowan Collins wrote: > Ferenc Kovacs wrote (on 06/08/2014): > >> Hi, >> >> I think dropping this behavior is a good idea, but I'm confused by the >> reasoning related to the langspec. >> This rfc targets php.next (which is a safe move as this has BC break >> albeit >> would require some questionable code), but the langspec was agreed to be >> based on 5.6 and document how that works. >> So even if we accept this rfc, and remove the multiple default case, >> wouldn't we still need to document the current behavior in the spec (maybe >> mentioning that it will go away in php-net)? > > > According to the bug report, HHVM also accepts multiple default blocks, but > uses the first rather than the last. It's probably not worth implementing > specific code there to take the last default label just in order to adhere > to a 5.6 spec, but is worth making it detect multiple labels to bring it in > line with the proposed change. > > So either we declare the php.net implementation to be in violation of the > spec (which isn't completely insane - the spec shouldn't mirror behaviour to > the point of incorporating the entire bug list); or we document the php.net > behaviour as "correct", but accept that nobody is going to implement that > part of the spec as written, and fix it in the next release of both the > implementation and the spec. > > Having the 5.6 spec match behaviour, and starting a 5.7 draft immediately > for implementations to actually target might be a compromise? Too late for 5.6 but it would have been one of these acceptable BC and sanity change. I did not even know it was possible and I do not think anyone would be insane enough to rely on that :) We will need a 5.7 anyway, so yes, 5.7 sounds like a reasonable target. And I indeed like this RFC, specs work is paying off. Cheers, -- Pierre @pierrejoye | http://www.libgd.org