rfc:final_by_default_anonymous_classes
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:final_by_default_anonymous_classes [2024/01/15 09:58] – danog | rfc:final_by_default_anonymous_classes [2024/01/15 10:33] – danog | ||
---|---|---|---|
Line 2: | Line 2: | ||
* Date: 2023-12-23 | * Date: 2023-12-23 | ||
* Author: Daniil Gentili < | * Author: Daniil Gentili < | ||
- | * Status: | + | * Status: |
===== Introduction ===== | ===== Introduction ===== | ||
Line 12: | Line 12: | ||
This RFC proposes to make anonymous classes final by default. | This RFC proposes to make anonymous classes final by default. | ||
- | This should also allow some additional opcache optimizations, | + | The main reason for this change, in my view, is to allow some additional opcache optimizations, |
+ | |||
+ | Another reason is mentioned by Nikita, "It makes very little sense to me that everyone needs to explicitly mark their anonymous classes as final just because there is a class_alias loophole that could, in theory, have been used to extend anonymous classes in the past.". | ||
Example, extending an anonymous class throws an error: | Example, extending an anonymous class throws an error: | ||
Line 36: | Line 38: | ||
class aliasExtends extends alias {} | class aliasExtends extends alias {} | ||
</ | </ | ||
+ | |||
+ | Rationale regarding '' | ||
On one hand, looking at code like '' | On one hand, looking at code like '' | ||
Line 49: | Line 53: | ||
Thus, I also propose the additional of an optional '' | Thus, I also propose the additional of an optional '' | ||
+ | |||
+ | The implementation PR will be provided by me in case of acceptance. | ||
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== | ||
Line 63: | Line 69: | ||
===== Proposed Voting Choices ===== | ===== Proposed Voting Choices ===== | ||
+ | |||
+ | Voting started on January 15th, 2024 and runs until January 30th, 2024, 00:00 UTC. | ||
2/3 required to accept. | 2/3 required to accept. | ||
- | <doodle title=" | + | <doodle title=" |
* Yes | * Yes | ||
* No | * No | ||
Line 74: | Line 82: | ||
2/3 required to accept. | 2/3 required to accept. | ||
- | <doodle title=" | + | <doodle title=" |
* Yes | * Yes | ||
* No | * No | ||
Line 82: | Line 90: | ||
===== References ===== | ===== References ===== | ||
- | * Internals discussion: https:// | + | * Internals discussion: |
* Previous optionally final anonymous classes RFC: https:// | * Previous optionally final anonymous classes RFC: https:// | ||
rfc/final_by_default_anonymous_classes.txt · Last modified: 2024/02/06 19:51 by ilutov