PHP
downloads | documentation | faq | getting help | mailing lists | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Name resolution rules> <Global space
Last updated: Fri, 18 Jul 2008

view this page in

__NAMESPACE__

The compile-time constant __NAMESPACE__ is defined to the name of the current namespace. Outside namespace this constant has the value of empty string. This constant is useful when one needs to compose full name for local namespaced names.

Example #1 Using __NAMESPACE__

<?php
namespace A
::B::C;
         
function 
foo() {
// do stuff
}

set_error_handler(__NAMESPACE__ "::foo");
?>



add a note add a note User Contributed Notes
__NAMESPACE__
There are no user contributed notes for this page.

Name resolution rules> <Global space
Last updated: Fri, 18 Jul 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites