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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -