rfc:namespaceref
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:namespaceref [2008/10/14 21:13] – stas | rfc:namespaceref [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
* Version: 1.0 | * Version: 1.0 | ||
* Date: 2008-03-06 | * Date: 2008-03-06 | ||
Line 17: | Line 17: | ||
Inside namespace, class definition can be used as: | Inside namespace, class definition can be used as: | ||
- | - Imported name - name mentioned in " | + | - Imported name - name mentioned in " |
<code php> | <code php> | ||
use Foo::Bar as Fubar; | use Foo::Bar as Fubar; | ||
$a = new Fubar:: | $a = new Fubar:: | ||
</ | </ | ||
- | - Full name not mentioned in import - Foo:: | + | - Full name not mentioned in import - '' |
- | - ::Foo - global name | + | - '' |
- | - namespace:: | + | - '' |
- | - Unqualified name 'Foo' | + | - Unqualified name "Foo" |
==== Pro ==== | ==== Pro ==== | ||
Line 50: | Line 50: | ||
Constants resolved in a way identical to functions. | Constants resolved in a way identical to functions. | ||
- | New syntax for static access is introduced: using Name-> | + | New syntax for static access is introduced: using '' |
< | < | ||
ClassName-> | ClassName-> | ||
Line 56: | Line 56: | ||
ClassName-> | ClassName-> | ||
</ | </ | ||
+ | |||
+ | ==== Pro ==== | ||
+ | * The last syntax allows to call static methods unambiguously | ||
+ | * Functions and constants supported | ||
+ | |||
+ | ==== Contra ==== | ||
+ | * The model is more complex and may be confusing for the new users. | ||
+ | * Unqualified name resolutions for classes and functions/ | ||
+ | * New syntax for static access | ||
===== See also ===== | ===== See also ===== |
rfc/namespaceref.1224018787.txt.gz · Last modified: 2017/09/22 13:28 (external edit)