rfc:namespaceresolution
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
rfc:namespaceresolution [2008/11/04 15:27] – added variant with 1) ns 2) global 3) autoload lsmith | rfc:namespaceresolution [2008/11/04 19:18] – lsmith | ||
---|---|---|---|
Line 7: | Line 7: | ||
This RFC discusses the way identifiers inside a namespace are to be resolved that are not fully qualified. | This RFC discusses the way identifiers inside a namespace are to be resolved that are not fully qualified. | ||
- | |||
===== Introduction ===== | ===== Introduction ===== | ||
Line 20: | Line 19: | ||
?> | ?> | ||
</ | </ | ||
- | Obviously its important that we make a conscious decision for these questions. Depending on how we approach this, users might unintentionally trigger autoload, call functions in the global namespace they did not expect or they could run into trouble when trying to migrate existing code to namespaces. | ||
- | Obviously one way to avoid this is via an explicit " | + | Its important that we make a conscious decision for these questions. Depending on how we approach this, users might unintentionally trigger autoload, call functions in the global namespace they did not expect or they could run into trouble when trying to migrate existing code to namespaces. |
+ | |||
+ | One way to avoid this is via an explicit " | ||
<code php> | <code php> | ||
Line 34: | Line 34: | ||
</ | </ | ||
- | While there is obviously | + | While there is no way to magically import the right things all namespaces, we do have the option of automatically falling back into the global namespace if the identifier does not resolve in the local namespace. This RFC details some alternative approaches for this as well as how things would be like if such a fallback would not exist. |
===== Possible approaches ===== | ===== Possible approaches ===== |
rfc/namespaceresolution.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1