Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76484 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40448 invoked from network); 13 Aug 2014 13:42:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Aug 2014 13:42:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.171 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.171 mail-we0-f171.google.com Received: from [74.125.82.171] ([74.125.82.171:46849] helo=mail-we0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E3/55-11625-44B6BE35 for ; Wed, 13 Aug 2014 09:42:28 -0400 Received: by mail-we0-f171.google.com with SMTP id p10so11505269wes.2 for ; Wed, 13 Aug 2014 06:42:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=eY8ALA9K9q8KJAbOfubMb9NyiFo+NkzXufjGBPP4oSA=; b=gDt3GO6JTCXGMBg7LUjVULGXEDIB2BqYeiqFWTs5DicDWDWZmX4l0K4hO1+QX4XpzO BF5BplWdmg0i3Cg6yL5F9ySZ5oBXgvueqxR+LcKIH+6MSdGh0dbicoFpb2863aBNETFF u41/ZwxftuX+BTiUBVal6uWrI8nAStX+Bowvo0fGabXiHmisKWaVH3VRTsPtWxWkiKiX RvCOKBAsH1JTyRH67m0rpzSQUUMUlXw+zTkTgmVozFxitOxy1wqtvhmr1S6BfsYOlPmP gjhonc7jgPKfjUsa0SOzudWIZ0HeNxRq+S2BxiNjgdu6w/qnyX/jkIBaQJdl9tvnx06e j6Fw== X-Received: by 10.180.82.97 with SMTP id h1mr5177729wiy.1.1407937344531; Wed, 13 Aug 2014 06:42:24 -0700 (PDT) Received: from [192.168.0.177] ([62.189.198.114]) by mx.google.com with ESMTPSA id e3sm4542864wjp.4.2014.08.13.06.42.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 13 Aug 2014 06:42:23 -0700 (PDT) Message-ID: <53EB6B3F.407@gmail.com> Date: Wed, 13 Aug 2014 14:42:23 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: PHP Internals References: <53EB3C6A.5010106@gmail.com> <53EB59AD.6020100@gmail.com> <53EB6103.4090600@gmail.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------000602060003010705080701" Subject: Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement From: rowan.collins@gmail.com (Rowan Collins) --------------000602060003010705080701 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Ferenc Kovacs wrote (on 13/08/2014): > > It is not selecting the first default, it just never needs to look > for a default, because it has already found a matching case label. > > > yes, and it continues the execution from the first matching case and > correctly evaluates the following defaults, as default matches > everything, which imo should be the correct behavior. No, it does not "evaluate the following defaults"; it evaluates all following code. Once a label has been selected, you can think of all subsequent labels being removed from the code completely. > having a different behavior for default when there is a preceeding > matching empty case is not the expected(from the userland point of > view) behavior imo. There is no different behaviour. Labels which do not match the input have no effect on execution, and default labels have no effect if any other label matched. --------------000602060003010705080701--