Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76481 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33574 invoked from network); 13 Aug 2014 12:58:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Aug 2014 12:58:03 -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.52 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.52 mail-wg0-f52.google.com Received: from [74.125.82.52] ([74.125.82.52:44487] helo=mail-wg0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DD/04-11625-9D06BE35 for ; Wed, 13 Aug 2014 08:58:02 -0400 Received: by mail-wg0-f52.google.com with SMTP id a1so11044166wgh.11 for ; Wed, 13 Aug 2014 05:58:44 -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:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=IVIAhCu8/FCZ5VblcvuBY5VTnR6StAMBQmM91a3Pv9s=; b=R2fZQXEvv5TBfSpad2hKTsWI9U8u8oyK5msiSXzADQs1uxi6K7QjsSqNfCLcIZyoub a47k9PI2kyXNlAoeuMoHAZLT3nx/kKrxnMTbA3EtHaKrpUDSXqnl3MCq7ZfI+jOkWF7Q IiaNrSu7+rkzKqV9nlj0O0MMJwEWq6jDh6KP78NZkCh3pl7mc75x4XK+AyC4nuyQORtR o2su2URgetRSxgz9ss5zKAOo5Lor2DDWimocQiI3aQoMqJLGmu5OXpH8C4yuD4hHGIUP 0Xx2Zyf21k+Fb5mBQCou3V+idqvCD+SGhpJWHZteSWzx6ttBxc5lYV0A+DNXdPcUBJq5 wvrg== X-Received: by 10.194.187.101 with SMTP id fr5mr4005516wjc.10.1407934724149; Wed, 13 Aug 2014 05:58:44 -0700 (PDT) Received: from [192.168.0.177] ([62.189.198.114]) by mx.google.com with ESMTPSA id r20sm67824951wik.0.2014.08.13.05.58.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 13 Aug 2014 05:58:43 -0700 (PDT) Message-ID: <53EB6103.4090600@gmail.com> Date: Wed, 13 Aug 2014 13:58:43 +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: Ferenc Kovacs CC: PHP Internals References: <53EB3C6A.5010106@gmail.com> <53EB59AD.6020100@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement From: rowan.collins@gmail.com (Rowan Collins) Ferenc Kovacs wrote (on 13/08/2014): > Btw. I've added a comment to https://bugs.php.net/bug.php?id=67757 as > I've found some really weird behavior for multiple defaults and I > think that it would be better to try to figure out and fix why do we > pick the last default in the problematic snippet instead of trying to > remove the multiple default support to get rid of the setup which can > make this bug to surface. You're misinterpreting the behaviour of http://3v4l.org/r3poR 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. If you supply a value which requires the default label to be selected, the last default label will be selected, as in all other examples to date: http://3v4l.org/lQ7WE