Re: [RFC] Disallow multiple default blocks in a single switch statement

From: Date: Wed, 13 Aug 2014 12:58:43 +0000
Subject: Re: [RFC] Disallow multiple default blocks in a single switch statement
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-76481@lists.php.net to get a copy of this message
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

« previous php.internals (#76481) next »