rfc:switch.default.multiple
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:switch.default.multiple [2014/08/12 21:34] – Minor grammar improvement. levim | rfc:switch.default.multiple [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 2: | Line 2: | ||
* Version: 1.0 | * Version: 1.0 | ||
* Date: 2014-08-05 | * Date: 2014-08-05 | ||
- | * Author: | + | * Author: |
- | * Status: | + | * Status: |
* First Published at: http:// | * First Published at: http:// | ||
===== 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. |
===== Vote ===== | ===== 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. |
- | <doodle title=" | + | Should we deprecate multiple default clauses in switch statements in PHP 5.7 and remove them in PHP 7, as outlined and implemented in this RFC? |
+ | |||
+ | <doodle title=" | ||
* Yes | * Yes | ||
* No | * No | ||
</ | </ | ||
- | Vote opened 2014-08-12 16:50 UTC \\ | + | Voting was unambiguously in favor of this RFC. |
- | Vote will close 2014-08-19 17:00 UTC | + | |
- | ===== Implementation | + | ===== Changelog |
- | * https:// | + | * Vote opened (2014-08-12 16:50 UTC) |
- | + | * Voting cancelled (2014-08-13 15:35 UTC) | |
- | Already landed in HHVM: | + | * Levi Morrison claims ownership of RFC (2014-08-14 17:13 UTC) |
- | * https://github.com/ | + | * 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