Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76478 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28680 invoked from network); 13 Aug 2014 12:42:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Aug 2014 12:42:00 -0000 Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.45 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.216.45 mail-qa0-f45.google.com Received: from [209.85.216.45] ([209.85.216.45:61597] helo=mail-qa0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1E/F2-11625-61D5BE35 for ; Wed, 13 Aug 2014 08:41:59 -0400 Received: by mail-qa0-f45.google.com with SMTP id cm18so9952913qab.18 for ; Wed, 13 Aug 2014 05:42:40 -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=HjLNDqBuwSfLZciK5QMra+GIOqSX7NUa4i/8+O9bntc=; b=lKuV2xAqFP7aHC8RvGDczVDoOh9iVQi9jS27SzAxOMQAl47V3wrCAVnoEao96uM4z6 +bR/p5NmjetgJQuSmp03pwMNZwx+XojYefjgqwy0Nw4r+G1OEmehFSf0/nIjfesSgZy+ 0KY/sMUIhFBNYWYZNdosYwfbneZrNnz4v8H/XiL9ZRIZB4Xa1OO0hSRQsYybt2E61VkC 9DOK8ieMPtwOnb/Ry27u+4YJmeobeBQw2U0ru8JYez9mc9vu0SWBn61H4s7hP/wenEQR W/1TObSsSfqxtsxZPYBG2Dr5mlnkABZXzpLh1pM1Qo4aHrKX6NxBMHe9/ZwMWYXTm+Pf oqZw== MIME-Version: 1.0 X-Received: by 10.140.103.75 with SMTP id x69mr2398243qge.17.1407933760409; Wed, 13 Aug 2014 05:42:40 -0700 (PDT) Received: by 10.140.102.111 with HTTP; Wed, 13 Aug 2014 05:42:40 -0700 (PDT) In-Reply-To: <53EB59AD.6020100@gmail.com> References: <53EB3C6A.5010106@gmail.com> <53EB59AD.6020100@gmail.com> Date: Wed, 13 Aug 2014 14:42:40 +0200 Message-ID: To: Rowan Collins Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a11c17ab6a834500500821fe5 Subject: Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement From: tyra3l@gmail.com (Ferenc Kovacs) --001a11c17ab6a834500500821fe5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Aug 13, 2014 at 2:27 PM, Rowan Collins wrote: > Ferenc Kovacs wrote (on 13/08/2014): > >> agree, and I thought about mentioning that, but I left that out, because >> I'm not proposing to remove that ability (and I see more use-cases for t= hat >> as mentioned in my previous email) but stating that this patch would mak= e >> an arbitrary distinction between the normal and the default cases. >> > > I'm not sure I agree that it's arbitrary. Having a switch with two > "default" clauses is like having an if with two "else" clauses; specifyin= g > two case labels which can be true at the same time is like having two > "elseif" clauses chained together that can both be true at the same time. > One is clearly an error; the other is just poorly written logic, and you > can't make the parser outlaw every instance of poor logic. Default is more of a catch all directive than an else (which will only match if nothing else), so I don't think that having two default is more "wrong" than having two "case 2:". --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --001a11c17ab6a834500500821fe5--