Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76375 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40084 invoked from network); 6 Aug 2014 12:00:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Aug 2014 12:00:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=lester@lsces.co.uk; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=lester@lsces.co.uk; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lsces.co.uk from 217.147.176.214 cause and error) X-PHP-List-Original-Sender: lester@lsces.co.uk X-Host-Fingerprint: 217.147.176.214 mail4-2.serversure.net Linux 2.6 Received: from [217.147.176.214] ([217.147.176.214:55298] helo=mail4.serversure.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 29/D3-13038-7C812E35 for ; Wed, 06 Aug 2014 08:00:10 -0400 Received: (qmail 11183 invoked by uid 89); 6 Aug 2014 12:00:11 -0000 Received: by simscan 1.3.1 ppid: 11045, pid: 11147, t: 4.7974s scanners: attach: 1.3.1 clamav: 0.96/m:52 Received: from unknown (HELO ?10.0.0.8?) (lester@rainbowdigitalmedia.org.uk@81.138.11.136) by mail4.serversure.net with ESMTPA; 6 Aug 2014 12:00:07 -0000 Message-ID: <53E218C6.20703@lsces.co.uk> Date: Wed, 06 Aug 2014 13:00:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: internals@lists.php.net References: <53E2006E.6080809@gmail.com> In-Reply-To: <53E2006E.6080809@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement From: lester@lsces.co.uk (Lester Caine) On 06/08/14 11:16, Rowan Collins wrote: > 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. It is perhaps interesting that this problem has not turned up before? As I indicated in another thread I was surprised to see 'default' as the first item in an example. I'm sure I'm not alone in always putting it at the end, and I quite often will have a previous block which does not have a 'break' so that the default element is added to other actions on some keys for that reason. How much of the core PHP is still 'normal practice' rather than 'by design' :) -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk