rfc:switch.default.multiple
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:switch.default.multiple [2014/08/07 16:49] – Add implementation diff pollita | rfc:switch.default.multiple [2014/09/16 14:08] – Closed voting. levim | ||
---|---|---|---|
Line 2: | Line 2: | ||
* Version: 1.0 | * Version: 1.0 | ||
* Date: 2014-08-05 | * Date: 2014-08-05 | ||
- | * Author: | + | * Author: |
* Status: Under Discussion | * Status: Under Discussion | ||
* First Published at: http:// | * First Published at: http:// | ||
Line 8: | Line 8: | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | https:// | + | [[https:// |
switch ($expr) { | switch ($expr) { | ||
Line 20: | Line 20: | ||
===== Proposal ===== | ===== Proposal ===== | ||
- | We have the choice of either fixing | + | This issue can be fixed by altering |
- | I propose we make defining multiple default cases in a switch statement a syntax error (E_COMPILE_ERROR). | + | PHP 5.7: Raise '' |
+ | PHP 7.0: Raise '' | ||
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== | ||
- | Theoretically there may be code out there (maybe generated code?) which relies on being able to define multiple default blocks and having only the last block executed, but this seems pretty broken-by-design. | + | There may be code out there (maybe generated code?) which relies on being able to define multiple default blocks and having only the last block executed. This RFC takes the position that multiple default blocks was an implementation detail that should not have been relied upon. |
+ | |||
+ | ===== Implementation ===== | ||
+ | |||
+ | * PHP 5.7: https:// | ||
+ | * PHP 7.0: https:// | ||
+ | |||
+ | Already landed in HHVM: | ||
+ | * https:// | ||
===== Proposed PHP Version(s) ===== | ===== Proposed PHP Version(s) ===== | ||
- | PHP 5.next | + | This RFC targets both PHP 5.7 and 7.0. |
- | ===== Proposed Voting Choices | + | ===== Vote ===== |
- | While this impacts syntax, it doesn' | + | This RFC modifies the PHP language and requires 2/3 vote in the affirmative to pass. Voting will remain open through Monday, September 15th. |
- | * Should | + | Should |
- | ===== Implementation ===== | + | <doodle title=" |
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
- | * https:// | + | ===== Changelog ===== |
+ | * Vote opened (2014-08-12 16:50 UTC) | ||
+ | * Voting cancelled (2014-08-13 15:35 UTC) | ||
+ | * Levi Morrison claims ownership of RFC (2014-08-14 17:13 UTC) | ||
+ | * Changes RFC to target PHP 7 for removal, with deprecations going into PHP 5.7. | ||
+ | * Added implementation for PHP 5.7 (2014-09-05 20:42 UTC) | ||
+ | * Voting is open (2014-09-05 21:19 UTC) and will close in ten days. | ||
+ | * Updated implementation for PHP 7.0 because of AST merge (2014-09-05 22:16 UTC) |
rfc/switch.default.multiple.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1