rfc:locked-classes
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:locked-classes [2019/03/10 18:12] – imsop | rfc:locked-classes [2019/06/04 18:56] (current) – Withdrawn imsop | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== PHP RFC: Locked Classes ====== | ====== PHP RFC: Locked Classes ====== | ||
- | * Version: | + | * Version: |
- | * Date: 2019-03-06 | + | * Date: 2019-03-10 |
* Author: Rowan Collins [IMSoP], rowan.collins@gmail.com | * Author: Rowan Collins [IMSoP], rowan.collins@gmail.com | ||
- | * Status: | + | * Status: |
* First Published at: http:// | * First Published at: http:// | ||
Line 13: | Line 13: | ||
Changing this behaviour for all objects would be a significant change to the language, with the potential to break a large amount of existing code. However, code written with no intention of using this dynamic behaviour would benefit from a way to switch it off. | Changing this behaviour for all objects would be a significant change to the language, with the potential to break a large amount of existing code. However, code written with no intention of using this dynamic behaviour would benefit from a way to switch it off. | ||
+ | |||
+ | While this can be achieved through strategic use of the '' | ||
===== Proposal ===== | ===== Proposal ===== | ||
Line 67: | Line 69: | ||
Since the proposed modifier applies to a class, not an instance, it would be confusing to use the keyword " | Since the proposed modifier applies to a class, not an instance, it would be confusing to use the keyword " | ||
+ | |||
+ | The name " | ||
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== | ||
+ | The keyword " | ||
+ | |||
No existing code will change behaviour, since the modifier must be explicitly added. | No existing code will change behaviour, since the modifier must be explicitly added. | ||
Line 86: | Line 92: | ||
The following additions will be made to expose the new flag via reflection: | The following additions will be made to expose the new flag via reflection: | ||
- | * New constant ReflectionClass:: | + | |
- | * The return value of ReflectionClass:: | + | * The return value of ReflectionClass:: |
- | * Reflection:: | + | * Reflection:: |
- | * A new ReflectionClass:: | + | * A new ReflectionClass:: |
===== Unaffected PHP Functionality ===== | ===== Unaffected PHP Functionality ===== | ||
Line 101: | Line 107: | ||
===== Patches and Tests ===== | ===== Patches and Tests ===== | ||
- | https:// | + | A pull request containing an initial implementation with basic tests is available on github: |
+ | |||
+ | ===== Reasons for Withdrawal ===== | ||
+ | |||
+ | This RFC was discussed on the Internals list in March 2019. See archive here: https:// | ||
+ | |||
+ | While the reasoning behind the feature was welcomed, the general consensus was that it was not quite right in its current form. | ||
- | ===== Implementation ===== | + | Specific concerns raised included: |
- | TODO: After the project is implemented, | + | |
- | - the version(s) it was merged into | + | |
- | - a link to the git commit(s) | + | |
- | - a link to the PHP manual entry for the feature | + | |
- | - a link to the language specification section (if any) | + | |
- | ===== References ===== | + | * The handling of '' |
- | TODO | + | * The restriction on '' |
+ | * Contrary to both of the above suggestions, | ||
+ | * The extra keyword was considered " | ||
+ | * If the primary purpose is to prevent // | ||
- | ===== Rejected Features ===== | + | The feature proposed in this RFC was deliberately conservative to keep the implementation simple, and bring it to users as soon as possible. However, it may be sensible to revisit the idea in combination with other concepts, such as packages/ |
- | None yet | + |
rfc/locked-classes.1552241523.txt.gz · Last modified: 2019/03/10 18:12 by imsop