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/14 20:21] – levim | rfc:switch.default.multiple [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 3: | Line 3: | ||
* Date: 2014-08-05 | * Date: 2014-08-05 | ||
* Author: Levi Morrison < | * Author: Levi Morrison < | ||
- | * Status: | + | * Status: |
* First Published at: http:// | * First Published at: http:// | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | [[https:// | + | [[https:// |
switch ($expr) { | switch ($expr) { | ||
Line 22: | Line 22: | ||
This issue can be fixed by altering the spec to match PHP's behavior, or fixing PHP to treat multiple defaults as an error. This RFC opts for the latter; it also provides a deprecation route. | This issue can be fixed by altering the spec to match PHP's behavior, or fixing PHP to treat multiple defaults as an error. This RFC opts for the latter; it also provides a deprecation route. | ||
- | PHP 5.7: Raise '' | + | PHP 5.7: Raise '' |
PHP 7.0: Raise '' | PHP 7.0: Raise '' | ||
Line 28: | Line 28: | ||
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. | 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) ===== | ||
- | This RFC propose that multiple default blocks will generate an E_COMPILE_ERROR and fail in PHP 7, and in PHP 5.7 it will generate an E_DEPRECATED warning | + | This RFC targets both PHP 5.7 and 7.0. |
===== Vote ===== | ===== Vote ===== | ||
+ | This RFC modifies the PHP language and requires 2/3 vote in the affirmative to pass. Voting will remain open through Monday, September 15th. | ||
- | ===== Implementation ===== | + | 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? |
- | * https:// | + | <doodle title=" |
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
- | Already landed | + | Voting was unambiguously |
- | * https:// | + | |
===== Changelog ===== | ===== Changelog ===== | ||
Line 49: | Line 60: | ||
* Levi Morrison claims ownership of RFC (2014-08-14 17:13 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. | * 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.1408047679.txt.gz · Last modified: 2017/09/22 13:28 (external edit)