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

From: Date: Wed, 06 Aug 2014 10:00:25 +0000
Subject: Re: [RFC] Disallow multiple default blocks in a single switch statement
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-76372@lists.php.net to get a copy of this message
On Wed, Aug 6, 2014 at 6:38 AM, Sara Golemon <pollita@php.net> wrote: > https://wiki.php.net/rfc/switch.default.multiple > > 'Cause this code is silly (even if it had case blocks), but we allow it: > > switch ($expr) { > default: > notExecuted(); > break; > default: > executed(); > } > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > Hi, I think dropping this behavior is a good idea, but I'm confused by the reasoning related to the langspec. This rfc targets php.next (which is a safe move as this has BC break albeit would require some questionable code), but the langspec was agreed to be based on 5.6 and document how that works. So even if we accept this rfc, and remove the multiple default case, wouldn't we still need to document the current behavior in the spec (maybe mentioning that it will go away in php-net)? -- Ferenc Kovács @Tyr43l - http://tyrael.hu

« previous php.internals (#76372) next »