rfc:namespaceissues
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:namespaceissues [2008/10/16 03:45] – add clarification about existing "use" statements cellog | rfc:namespaceissues [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Request for Comments: Namespace Issues and Greg's Solutions ====== | ====== Request for Comments: Namespace Issues and Greg's Solutions ====== | ||
- | * Version: 1.1 | + | * Version: |
* Date: 2008-10-15 | * Date: 2008-10-15 | ||
* Author: Greg Beaver < | * Author: Greg Beaver < | ||
Line 46: | Line 46: | ||
</ | </ | ||
- | ==== Why Stas's proposed solution doesn' | ||
- | |||
- | [[rfc: | ||
- | |||
- | > New syntax for static access is introduced: using '' | ||
- | < | ||
- | ClassName-> | ||
- | ClassName-> | ||
- | ClassName-> | ||
- | </ | ||
- | |||
- | Although this would in theory solve the ambiguity, it does not solve the ambiguity for all existing code, which as we know uses this syntax: | ||
- | |||
- | <code php> | ||
- | <?php | ||
- | ClassName:: | ||
- | ?> | ||
- | </ | ||
- | |||
- | In fact, this proposal would require every single reference to a static method or class constant to be rewritten as ClassName-> | ||
- | |||
- | The only fixes that can solve the problem are fixes that do **not** force PHP developers to rewrite code. Every proposal below would only require changes to as-yet-unwritten code. Solution #3 would in fact not even require changes to code written based on PHP 5.3alpha2. | ||
==== The solutions ==== | ==== The solutions ==== | ||
Line 210: | Line 188: | ||
This will be better for 99% of scripts, as evidenced by the ratio of internal vs. userspace classes (see http:// | This will be better for 99% of scripts, as evidenced by the ratio of internal vs. userspace classes (see http:// | ||
+ | |||
+ | ===== Why Stas's proposed solution doesn' | ||
+ | |||
+ | [[rfc: | ||
+ | |||
+ | > New syntax for static access is introduced: using '' | ||
+ | < | ||
+ | ClassName-> | ||
+ | ClassName-> | ||
+ | ClassName-> | ||
+ | </ | ||
+ | |||
+ | Although this would in theory solve the ambiguity, it does not solve the ambiguity for all existing code, which as we know uses this syntax: | ||
+ | |||
+ | <code php> | ||
+ | <?php | ||
+ | ClassName:: | ||
+ | ?> | ||
+ | </ | ||
+ | |||
+ | In fact, this proposal would require every single reference to a static method or class constant to be rewritten as ClassName-> | ||
+ | |||
+ | The only fixes that can solve the problem are fixes that do **not** force PHP developers to rewrite code. Every proposal below would only require changes to as-yet-unwritten code. Solution #3 would in fact not even require changes to code written based on PHP 5.3alpha2. | ||
===== Changelog ===== | ===== Changelog ===== | ||
* Version 1.1: add [[# | * Version 1.1: add [[# | ||
+ | * Version 1.1.1: move Classname-> |
rfc/namespaceissues.1224128700.txt.gz · Last modified: 2017/09/22 13:28 (external edit)