On Wed, Aug 13, 2014 at 2:42 PM, Ferenc Kovacs <tyr...@gmail.com> wrote:

>
>
>
> On Wed, Aug 13, 2014 at 2:27 PM, Rowan Collins <rowan.coll...@gmail.com>
> 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 that
>>> as mentioned in my previous email) but stating that this patch would make
>>> 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; specifying
>> 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:".
>
> --
> Ferenc Kovács
> @Tyr43l - http://tyrael.hu
>

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.

-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu

Reply via email to