http://www.sitepoint.com/forums/showthread.php?t=468605
Thoughts?
PiHiPi wrote:namespaces
Namespace body can contain constant, function and class declarations. Qualified name is looked for in that namespace:Code: Select all
namespace Foo { body }
Code: Select all
echo Foo::bar();
Unqualified name is looked for in current namespace and than globally. 'global' is a namespace and can be referred as such:
Code: Select all
echo global::foo;imports another namespace in the scope of current.Code: Select all
import <namespace-name> import <namespace-name> from <path>
classes
'extends' accepts qualified class names:
Constants are resolved at run-time, that is, arbitrary expressions are allowed on the right:Code: Select all
class Foo extends OtherNamespace::Bar
Code: Select all
const X = foo() + bar();