rfc:use_global_elements
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:use_global_elements [2020/01/28 14:20] – formatting tandre | rfc:use_global_elements [2020/02/11 19:05] (current) – Declined tandre | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== PHP RFC: declare(function_and_const_lookup=' | ====== PHP RFC: declare(function_and_const_lookup=' | ||
- | | + | |
- | * Date: 2020-01-27 | + | |
+ | * Date: 2020-01-28 | ||
* Author: Tyson Andre < | * Author: Tyson Andre < | ||
- | * Status: | + | * Status: |
* First Published at: https:// | * First Published at: https:// | ||
- | |||
===== Introduction ===== | ===== Introduction ===== | ||
Line 28: | Line 28: | ||
* Some builtins such as '' | * Some builtins such as '' | ||
* Version control history for lines would change if '' | * Version control history for lines would change if '' | ||
- | * New contributors to a project would often be unfamiliar with any applicable coding style guideline | + | * New contributors to a project would often be unfamiliar with any applicable coding style guidelines |
- Avoid using namespaces (this is forbidden by [[https:// | - Avoid using namespaces (this is forbidden by [[https:// | ||
- Mixes of the above approaches. | - Mixes of the above approaches. | ||
Line 127: | Line 127: | ||
8.0 | 8.0 | ||
- | ===== Proposed Voting Choices | + | ===== Vote ===== |
- | ==== Yes/No Vote ==== | + | Voting started 2020-01-28 and ends 2020-02-11. |
- | (Requires | + | The overall change requires a 2/3 majority. |
- | === Severity of redundant uses === | + | <doodle title=" |
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
- | When '' | ||
- | | + | Secondary vote: When '' |
- | - Fatal Error | + | |
+ | | ||
+ | - Trigger a fatal Error | ||
- Allow it and don't warn | - Allow it and don't warn | ||
Line 145: | Line 149: | ||
Otherwise, the option of " | Otherwise, the option of " | ||
- | + | <doodle title=" | |
- | (Note that explicitly adding '' | + | * Warning |
- | I don' | + | * Fatal Error |
+ | * Allow and don' | ||
+ | </ | ||
===== Patches and Tests ===== | ===== Patches and Tests ===== | ||
Line 228: | Line 234: | ||
< | < | ||
- | One option that I haven' | + | One option that I haven' |
only look in the global namespace. Any unimported unqualified usages will | only look in the global namespace. Any unimported unqualified usages will | ||
be treated as fully qualified names. This would match the proposed | be treated as fully qualified names. This would match the proposed | ||
Line 251: | Line 257: | ||
From that perspective, | From that perspective, | ||
- | > and changing | + | > It's fairly common for NS\SubNS\ClassName to mention other classes from NS\SubNS\OtherClassName right now, |
+ | > (more commonly than use Exception, use Throwable, etc in some cases), | ||
+ | > and [opting into that a single setting such as '' | ||
+ | > would require changing a lot of third party code [to get unambiguous function and constant resolution easily]. | ||
> A separate option such as `declare(lookup_classes=global)` would allow migrating to that, | > A separate option such as `declare(lookup_classes=global)` would allow migrating to that, | ||
> but would confuse developers switching between codebases using different settings of lookup_classes, | > but would confuse developers switching between codebases using different settings of lookup_classes, | ||
Line 270: | Line 279: | ||
Arguments for: | Arguments for: | ||
- | * Classes don't have the ambiguity functions and constants do, and already have autoloaders, | + | * Classes don't have the ambiguity functions and constants do, and already have autoloaders, |
* Can potentially support '' | * Can potentially support '' | ||
Line 356: | Line 365: | ||
[[https:// | [[https:// | ||
+ | |||
+ | [[https:// | ||
rfc/use_global_elements.1580221227.txt.gz · Last modified: 2020/01/28 14:20 by tandre