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 revisionLast revisionBoth sides next revision | ||
rfc:final_by_default_anonymous_classes [2024/01/15 10:33] – danog | rfc:final_by_default_anonymous_classes [2024/01/15 14:36] – ilutov | ||
---|---|---|---|
Line 14: | Line 14: | ||
The main reason for this change, in my view, is to 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.". | + | Another reason is mentioned by Nikita |
Example, extending an anonymous class throws an error: | Example, extending an anonymous class throws an error: | ||
Line 29: | Line 29: | ||
- | Optionally, an '' | + | Optionally, an '' |
Example, extending an open anonymous class does not throw an error: | Example, extending an open anonymous class does not throw an error: | ||
Line 41: | Line 41: | ||
Rationale regarding '' | Rationale regarding '' | ||
- | On one hand, looking at code like '' | + | On one hand, looking at code like '' |
- Has a name (even if it's not immediately obvious) | - Has a name (even if it's not immediately obvious) |
rfc/final_by_default_anonymous_classes.txt · Last modified: 2024/02/06 19:51 by ilutov