PHP: using sub-namespace class inside a namespace -
suppose have top-level namespace \outer
, have sub-namespace \outer\inner
, have top-level namespace \inner
and in class in \outer
use inner
this
use inner;
then inner used?
\outer\inner // ( sub-namespace )
or
\inner // ( top-level namespace )
i confused because php said \
optional top-level namespaces?
when have namespace \outer
in class use inner
going using inner
top-level namespace. if want use subnamespace sould \outher\inner
as stated in php using namespaces
lets first file was:
<?php namespace outer\inner;
<?php namespace outer; /* qualified name */ inner\foo(); // resolves function outer\inner\foo
Comments
Post a Comment